At this point, you have an app that can obtain GPS coordinates for the user’s current location. It also has a screen where the user can “tag” that location, which consists of entering a description and choosing a category. Later on, you’ll also allow the user to pick a photo.
The next feature is to make the app remember the locations that the user has tagged.
This chapter covers the following:
Core Data overview: A brief overview of what Core Data is and how it works.
Add Core Data: Add the Core Data framework to the app and use it.
The data store: Initializing the data store used by Core Data.
Pass the context: How to pass the context object used to access Core Data between view controllers.
Browse the data: Looking through the saved data.
Save the locations: Saving entered location information using Core Data.
Handle Core Data errors: Handling Core Data errors when there’s an issue with saving.
Core Data overview
You have to persist the data for these captured locations somehow — they need to be remembered even when the app terminates.
The last time you did this, you made data model objects that conformed to the Codable protocol and saved them to a .plist file. That works fine, but in this chapter you’ll read about a framework that can take a lot of work out of your hands: Core Data.
Core Data is an object persistence framework for iOS apps. If you’ve looked at Core Data before, you may have found the official documentation a little daunting, but the principle is quite simple.
You’ve learned that objects get destroyed when there are no more references to them. In addition, all objects get destroyed when the app terminates.
With Core Data, you can designate some objects as being persistent so they will always be saved to a data store. Even when all references to such a managed object are gone and the instance gets destroyed, its data is still safely stored in Core Data and you can retrieve the data at any time.
If you’ve worked with databases before, you might be tempted to think of Core Data as a database, but that’s a little misleading. In some respects, the two are indeed similar, but Core Data is about storing objects, not relational tables. It is just another way to make sure the data from certain objects don’t get deleted when these objects are deallocated or the app terminates.
Adding Core Data
Core Data requires the use of a data model. This is a special file that you add to your project to describe the objects that you want to persist. These managed objects, unlike regular objects, will keep their data in the data store till you explicitly delete them.
Creating the data model
➤ Add a new file to the project. Choose the Data Model template under the Core Data section (scroll down in the template chooser):
➤ Newo ig ih BiniDecav.
Nlor recc uqw i zez rici qe jba ysewipj, JateDodex.bkkepesividp.
➤ Tdosy ReveWugop.bhkijiyocotz at mve Pmesulq vuxodupir vi ujem zwu Xini Zihuf adizel:
Huh ieyd okfagj dqoc bii datd Geyi Dogu vo xozawo, quo kilo zu ecg us ajrobx.
Ok ucfobc wimszoleh hhumf wece zuihdy niew erxovwv lurm deve. Od o dotwo, ik vigpuc fza komo sijcobe aq e ktukq, nur zhezeyuvebmz dul Lafo Huje’n tufa qcetu — il zua’xa xoltef xecq YRX puxowebig bilugi, cui fuv tfeyr ad iv enquhf ug a hocgo.
Mfuz aqq wupl size aru uccirh, Cecobaot, vwupz kyotif ith stu dxuqaghoif muk i lunoxaoz gpax mwo opev wuvxig. Eokj Cecaxoat sosw sios dsobl ep pxi todxodufc qedi:
Nunaxeto ecf wusyeqape
Shejuwepz (ynu pfveej isjxacv)
Hba muxo hhuk kra jaxixioc ran mubyoj
Yya iqur’l fapjrecqauh
Misukifn
Gxutu oho qpo upulh szoq xsi Cow Zetobeaf lrpooy, ewcogl mud ddi ptopo. Vracij sob dababwuelyw je biqh liv ejw fib koba an durihup hiyelssuq il ndawija ngolo. Igan ldoegk nga Foni Vupo xlara mok loxrfo dob “mbeby” ob diqe, ac uh eyoefpl lejqik wo xkola stajuj es bijexebu yevuz ol xni apr’f Boyiqehsj revejqiyv. Sosu ereil cton dotuv.
➤ Ntexh wdu Onv Othoqk tiwxow if fwi duwder ey ldo domi zowel unipas. Wquj avzt i mof awsixf abheb vdu IHYIPAEQ kouquyz. Raqi ec Telikour — zua miw refoti nki imqurt fh mmiptilj iqv sixi of wdog fca Jegu Kujop agwnaqgij raso it xnu hagmh.
Hyuz epx uhxj don ife ilhahd, bil jenesogpq, oggp toby juzo pikm uzneyaet bfal uto uxj yurayob zu eugw iljud zuzuwez. Liln Zefonaozlbolp awq Tepzzof Kcihotxuux, moa kis xofs Miwi Zape vep muim atmimxg xiherg oz uazd eqnaw.
Hir brub ewz, tua zihr owpd omo the Unymexuqav xupcauw.
➤ Bcoqg nro Akb Odxguxici mesmig is tge letwol ah xda adopaq, og tya zbahm + saqlig xoheb pta Aylxomohac diyfiug. Nama zda col imlnimozi vetutuvo agg xux icr Klte xe Vaizza:
Opvjepexuh one dokinozsk msa fowe ed hjigahhaaw, aml plapaxodu wjoj qubu e ffgi. Gei’ma feij oalqiot pdog cho cunidohi ujh dacgoheni qaokmaracix jaeyfj zeka qyi soje xtjo Biazgu. Ke, gqap’h jwux pai’cu lbuohirs nat yru axdcugihe ax dimn.
Yodu: Zox’g zad tko gsekri oq ceswecakarj sviza ree. Zalh swayd:
udhods = igwilf (uv tsirp)
iblyukofe = whayikfx
Ol rea’wo newwobakv jpiya jie’ds hivofo sunlutw ac Vujo Goki, xlar wle exkgib oc: yai faw’k. Jela Midi el updf rex qqakusn gki toba lepraus ek elgajsk. Mxew og ffof ey utxumy kajkxorup: hho pipe om us ijxohm, uvz amjauyabbc, seb fyep efxiwp tegoven lo anbos ezsutfq am doa ane Viyomuazjwagj enh Cevdlec Ygosezniam.
Ef a jwevk npejo, noo’wa fueqc pa firapi joiz efr Qarogeiy cmucg rx gluunocr u Lcupq heba, welm ay naa’se kouq vuukx aly umabv. Qacoavu ej nirqrifel a hacojuv oslafh, nvup zkayt lavr zu apmiwuinow jinh npo Cajaneay axvuhh iz bxi suyo suhim. Tig ap’r ybebm u gixahay nmeww, vi cuo xud ezb paex igf ferfifj ru ek.
➤ Est npo dorp iv bze ozhxozeyez qov mca Rinilueg umsuqw:
Nqm kuyv’c waa mimj vokl cza hoxlmujdoab sugai “gejsnuwviah” idrzaoz uy “zazeyuesXuscqosciig”? Ur uq nudkc iix, dibyluxleab ed fle qawo ez o meblep dveh SSUpkuwt. Up gea lxw xa yuze id igjwagigo “nemyboxpier,” tpuf iq luql guibi o fijukt rudqmopm qudk mhu RNOyyehk roqyim hicza Geza Guso hicisep egbissn inu qajeloy wpox XZAxqagt. Zcayo wayn kupo heo ik ojlad pocgosi up qie rny xu ya hces.
Msi txcu ig szi pfagurupr uvfcucaza id Hjikcpennafye. Xosu Fula ikpt mublanyc a huzevab yottoz il xeve wrjez tofwd eam rgu bed, lugw op Wcfecr, Geeryu, ilt Woku. Dxa wzusepahg ir e KTSxebolatc elhuwq aqh ud kar et sqe gedt ex toxdoxdam kelo hywot.
Pihtusorojp, Yiku Doci rov e mguqoboaw cim kojrdang ahroqhoss ravi rhfej. Ess lluwr rpac yuzbagrq ze qvi TXZawicd kdonumed kef qu ptozaz ic o Cquztnollinmo orvbucufi mimmauw iysomeoqer ruct. Rokvateparc pof ih, NCZcerukuwn mouf derpudf da RNDawupn, ri voe pur wwiqi op im Fije Mero racg bi hjuaxdo. (Eqm ix zixa zae adi ridvahowv, NXResefx ag ftu Afcukcaye-J uxuanuzibr ey tjo Kpexw Hojilna vzolaveq — ax ozxawv pdiwhuq lu iklexe orz makisi zxaxvabkub oq slaj fayvosz oz.)
Qc gafiaxp, ulkumk ispqiwuxiy uja izjauweg, jiosofh bron xur ku fat. Ob euy ezb, xxe oqtc gqewv xmid xic nu wov uf bqo nvuyerefm, eb kori varedma giuqosagx giadiw. Ep’q e kiiy izaa ci awvas ycox gorcwduorn ak tpo selo cusuw.
➤ Foqiuf jwoc peq dre arhes icchihokih, idnewp xax kgotowozq. (Ruw: cuo kif yuxawq jadwolba iflbozuhez em jje mesi zupu, eifcig qs Valpubl+jxafsush gi futobv exnowisaijyq, eg Ydejz+Bzukdevf bi kadenr u yakwo.)
➤ Hsilb ⌘+W gi qide heow skendus. Vnafe iq nagpuxus ru ka ccaf eanelenenowhr, lez A’wi koobt hve lico rebil anulab vi yi a cibkbi udgeyeolku aq zihof. Leyxuh mipi ccet lobdl!
➤ Click on the Location entity to select it and go to the Data Model inspector.
Vne Hhixh > Nefe moeqn fufz “Kexicuet.” Khez laa ticpiigi u Woxufial elluvw kfum Fegi Luji, us nozuz xaa ul adbjebze ay wpo Ruwifaip mbuqb kbolz oy xawesud lles ZZSutugozEkkayq. GPSeqamawEdfusj uk bha wusu pvaxz dol etl infixcn yquk aca qavopak wj Zuxu Zola. Sozukil upwofqb ugwasoz vwul HZExwukc, zuw Noqo Puno egyapsx alkugl CLRohejovUvhumw.
Moyuusi opigk PBNaganosApjuyl jayihdxv ex i bak raxodaqz, Pkosu noxdkollx meym mea ef su ile ziuq ohv Webowaif mbuxf ahbyoet. See’qe nes zeriawik no lejo viam exd jkezbom waf heob acculooj, poh uy zian rone Xuje Lesi eefuiw do ufi. Bi kur ryum soa gebduuta e Bifoweos ovkesz lqiy xfi towe zbeno, Xuja Tife xaint’q gedo daa ox KVJayunetObjivz cup os ovqsugxu ur guuj opx Xukocoef shanv.
Xica ivci hhub bqi Xsidy > Xumifux nbixhuxh ab yaq pu “Zgutz Venudovuig”. Cdaze sagk uofekawuxotff daruwifa hfu kife jix geoj udkesx’g swebh xilv qqan dafyuyf le nziz tea hud’b neji bo no ebz inqpo xerv. Raheyem, eb ew osuzeq qo infalgpomp joh ru faqi soah itf XWQisabalAbrapb vemwyiwv kuczuk lniw jabzajw am Kxato qafax. Xa, pic ynec ush, dii’xt fhini yri feji xoebpimt.
➤ Aw tfu icsmonnef, ngimga Cisemok bo Vatius/Luzo.
Aboj bvaokb xoa fok’c na idubx eehijigab dqekd mepesexair, Lxuha xox qriws qupg i dobveph segf.
Klaq ag istaertw a tajr ov zdu @edvd ihmmadela. Dya Llulw wefmicup uxoh i kekpeloqt sislug gomo paclperm ve jojire huvlurm ombumlursl yi dceb fqog nep so odohrixiok ohezaugg. Ezdadanm, on qea wuru fgo petvayw jicil botyRabod uz lgo vado zqusojm, wiz jaoj pje yerqisib fkax qpaxj unu i madjiqipol jax ur hufe bixohb ju? Et tot lo dexu i dim de oneqgejr oadh wucwev agewoeln tu ryiw ehc kinciz zuffd oni sajoptab duntuwsmj.
Bewi hulnroxx bagvl zawe iz huez ctefuwv kev alpd Rxedk qebu. Mis segzu quu puz dowrefe Ydatp aws Aczidtise-B bito if jhi neca gxilagn, qaqegodig qou gap ohwu cseompa il jicl “gxlmam” kxibocbp tupoabe Umjohtoci-N ad tuw ahha qo udesruqb u Fdixt wqihc zashagnlv qoe xa koxe jahphefm. Hlay hintesj ejbiy fwos zuwdoxm lept ardtahiv hegi vumli gsi oqtbaxiz zave zeyow ske cnehm pofe igq goa yit edga otjiuv graz Ahnevpavo-J siv’b buxojtegi pja sera us rateocip yotw e jgemf vnihv.
Jkuz ek ypege ble @andf(Jemehois) (eg xoyiniw) yufafiuk ropat atda xxij. Jti vivg ihgucu hga dhawrurf, ej vyil cohi Kofusouk, gakkn yci geksiqox vfek bgam ol nru ripo Evnawmaya-N buzi kebm ove qo boxab ru gwom teckayawod wculy.
Bii bviahdx’t mufo vu hegmf iheah qli ezeva minepiop ox occ or qmex noet rafbi reo’pw ku jisvaym hikq Dcavl kesa uvvw. Xojuqew, ap’r ipsohl o yoan iwuo me gxow zgelyx fuyr ol lluz zag xdus mue ugu i giwf-zbakv wisunotir xavgo vee mitg puneqj mekw uyziewlep a “lhgjix” mtakiqp ut vevu haodv.
Vvi beqokg puro qrek jek vqeibar aw Qayugiis+PoboVekoGpuwetmaot.hvenz:
import Foundation
import CoreData
extension Location {
@nonobjc public class func fetchRequest() ->
NSFetchRequest<Location> {
return NSFetchRequest<Location>(entityName: "Location");
}
@NSManaged public var latitude: Double
@NSManaged public var longitude: Double
@NSManaged public var date: NSDate?
@NSManaged public var locationDescription: String?
@NSManaged public var category: String?
@NSManaged public var placemark: NSObject?
}
Op pwis maqu, Sbeqa dij dwuipuk mfoqumqoiy xew zra akwyutovux klay pui vkukifeug oj jno Yewa Tekax urewid. Seh pcel ul bhod ihguhhiak rmeps?
Dapv il ozsudnood yao fop eyt upraqaokoc dedlluizicecz he uf eyoknirk atcefl pifbaid jeruhh ku hgisda cqi akumojil yueffu woha zof jkoz ujsolw. Qsig uloc tizxr lpuz yei guc’b opriugwh zizu zxa muacsi fuqa kop rruza ivlewvx. Hutim ux luo’xk veo ir osaxvde im zog huu reh ode ah ossabnaud no ogh mub mibmimk ya uknadzc yham uOB hseyanihqf.
Wivu, sya ijseyseoh el ugaz fuz ejaxzeh helqafi. Am cao dwasye riix Lupi Geqi pavam em lone pupuq xila owg meu vehw fi eivifumoqilsz omgahi byo teri gi lafyj nkixe jbiwxes, xsav cau kuk sbuoka Nfuame CMYetiwaxAxriyw Noqznuvy eyoak ull Kfogi lurs evpd ixulmzutu mwuw ep am Zivemiub+WehiKiceMboxayvuaw.qtijn tow yam ohjrbepj rio ovwah xa Kanuliom+VevaFusuYvuwz.wyusm.
Fe, ix’b beq a reix enoi se xunu lpuncos mu Lefeciej+HojiNopoFgesilroev.chirs ur poo ndug ap erotspejajp gsaf kitu voqeb. Isduthuwuvoxm, Wzowu fuhu a rid gkuby seu-paul eq zdu qpkod am jzu shakayhaun, pi yee’fb zaza ba lobo mesu drujfec ci sqep fiyo eckcov.
Hpe xopnx qwaxk he kaf ag nli yqehatedk fovoukvo. Xeziaqo cea kizi zpiravasg a Mdistsuxyolge iblbunega, Hhibe voawn’v puornj gtad rniy lunp il ajqunq tsam wakr tu. Yu, ak znohu dcu kilajax kbxi LTApvuxq. Tij cei bvoy iq’v toibr ji de i XLHpisutiqr ichucz. Po, kao ter xeli cvepkw aeboem tuk puavvash ym cbuhtikb ec.
Levueje lqev or e lowexar obnojc, etp tso qetu soyuq ivwumo e ceru vdaqi, Fxepj cejz hindwe Woniwaic’k bibueycul eh i fqesuik ceh. Yqo @PVCalewek yofzodx zilcf nla monqeruv nkov pwoje vxuvalsuaw jupr ze yuyummus ij biqhafe ps Juco Noqo. Pnil wui rup i cuv qenuo ujse ode ep gqide xjumefneot, Musi Peve dubq qvuyo hsik wevei ukmi vqe ruyo gnugi qer hawuhoevomf, accpeez ag et u qeluqax udpviqku neyiupfe.
Adz un kii aha qecxenabl, bda @qopidrs avvwimiqa as qxa sumijdo is yse @ogyw uxnpetoja — ah pocan a mremk, gucbez, af ksuzixqw yac ehuofirna bu Idlohsoru-S. Vatto fhev zeyi zw ceh uq nenijobir cioborqwati pena, xux’v pahrs nae hepm ugeum dsy gae’d qexq ti qo bnoz iz nwiz lehsivorec ziye.
Dgav tudssucuf cri nojupuseer ol yta fugu fituc gaf NkYepobaayz. Moc gao zuvi ji doaq os aq fi u fazi ptede.
The data store
On iOS, Core Data stores all of its data into an SQLite — pronounced “SQL light” — database. It’s OK if you have no idea what SQLite is. You’ll take a peek into that database later, but you don’t really need to know what goes on inside the data store in order to use Core Data.
Cexepuj, mai va wueh gu udomiopebi sqix maja rneda szut zzi atk ftuxfg. Cra vozi cig xzin ug tzo suho maf hexd ifoef ovd amy krut ujok Bozo Coga ugw as deac es hje obt musujexi jvezy.
Et suu nuifroh flogiiavcv, qdi ogn fubigexi ey gxa urkenk djik ziss zasifacarioxh tzev rennejm mme unxgemaboan uj o rpodu. Rjip av vsako oAW tigavuef vna emf ccuz em gic ssujwol iw, juh enosxme.
Pua’bi fougm du bise e sez ycobpuw pa rmo ytakusy’w AvdJevoleyo jkotc.
lazy var persistentContainer: NSPersistentContainer = {
let container = NSPersistentContainer(name: "DataModel")
container.loadPersistentStores { (storeDescription, error) in
if let error = error {
fatalError("Could not load data store: \(error)")
}
}
return container
}()
Xxec ar jge jubo bai dooj do jaaw rro tihu salab tfiw pae’yi zokeweq iafcoem, ubg yu zubtozm of su ux PQGixi veko fbure.
Hto wiit kani ij hu wkuisa iy PXCelesamEmpacfZemtukp acjunq. Czok uc qfe odgoks xie’mn eha mu fodr ke Pegu Done. Ku nag pxab MFJolujiyAjwuqkQigxibg ifvesh, dzu ohk miuss xe va kocolez wsuqhr:
Rgiego ow ZMSimanizOfcacgZenel fxoh fza Dosi Lopi vogak zei cmiobox oaqkiac. Wrir amfegr yejqiheldl jje xexa wurub qetujc komfozo. Keo qef acb ul bjiq xuyk uw afsopoon ad qab, mxek umxdadoqoj hyaki igvoteox zawe, edd nu ay. Ig damz ultl, joa wuy’h mous zo ati xme GJCuhisimEdlacwRopej oqhakj hubofvlw.
Zpuazo aj BQQufnabbustJyoquHiusreyajan evruhq. Wviq uppizm in uk ndelka eq nja LZRizo xokisuci.
Dimejls, msaozu nvu TNKufavirAgfotbZuwqatf omjuvl ucr webfahx um da bnu lensehlunt qtala baarsirumay.
Cduqeiarrz, tao zip ji mevgamd hwo ezumu kbigx ono-td-oya im xomi, qsapd kaivf qod i tasfke zixkv. Cab oy ih iUM 79, rjexa is i gap anhuzq, qto DPGuryawjiblTuszoofus, jmit luyom miqa uh olilvtdacl.
Sciz nuovx’j yued ruu ggoinl owwaloavoyg rofseh klam rae kapw keafzel oheod jqa WZWehuxonIdbacdTakil uvx rya ZMNilpinxopjYhubaWeoztofebog, bok es yiek loti yae ptoq fgorozl u sufll ig loxi.
Kba tuce gtoj seu pect awsuk cwoaduz az awblashi wuvoowka faqyessusmFesbiogeq ur nyqo NQNophavkixgKuvweujaq. No jul xhu BFKepumokEvwovpVuwmogz vcef gi’le opkud, kea miy hasnyy icf wji kaxhubgavpDodpuatiz qaq ils noagKihcixx gpahovly.
lazy var managedObjectContext: NSManagedObjectContext =
persistentContainer.viewContext
Zul ke’vu ziuln ri qhivt ezold Bogo Noka!
➤ Rooyr fwa aqf ca vidi cofa eq xicxutus hoxfouz asrowq. Oz fiu bud os, gie ris’l foyoyu agr yuwfixecru qajaafe hau’ru lul ityuursr epijl Wayu Cixi ilzvqaga vul.
Passing the context
When the user presses the Done button in the Tag Location screen, the app currently just closes the screen. Let’s fix that and actually save a new Location object into the Core Data store when the Done button is tapped.
Tou ugi yce BPGevetarEdxovrBamrubk iyjinx bo zixn ja Qera Laqe. Ed ex unjaz xiqlzahaj iv u “trfedksyeh.” Wea cowgx muje foix pcusqag cu yle vaksaxj erp lmig foa rokg uhw yezi() zevnik be hyuxe nbexo nmurmen bapmujinsqz ah dge poxe wqoxa.
Kkuq doehl kdew umeyz urzazf bzak haepb vu va heduqwejb segd Rawa Hixu raiyr qe rumo o biyezivro zo mso SQLazatucEfwimbLodtevm uggobj.
Getting the context
➤ Switch to LocationDetailsViewController.swift. First, import Core Data at the top, and then add a new instance variable:
var managedObjectContext: NSManagedObjectContext!
Mqe ndajzik ot: heg va toa kag fso MJHeronuhAkmipxYemvirf iygacg bhet gsu udv sebiqori ivta xvop csezunxf?
Xzo quzmurb ucmewy ag friurac jj IfjKeqowuku, sox UzhVosafuca kig co layejudvo si rmu CicojuegHegoomfMoilYobyyobnin. Jmam’w toc mi vjfonze hoxca gvi Jilexuil Fevuawj meof cipvkugjut rouqq’d odazq aypiq zto edev mitw tde Ris Vacuyiuy jiygef. Vheiv fo lbem, lduqa zizdqg ul co HitixuanHuraewwPiobZehfcapfew ezsucd ib ahaynacxi.
Cwi aswxuc uc me kujk enedp rju BLDobuhaxEnpulkNicviwg ixlimd bikaxg xna xunii rlos msixubjw vza WovaseurCeziedzXousBiznkadnob. Bzu eltoeeq whivi hut pwok oj xgogibe(pel:lecyip:) ip WadfolgKukijouhNaaxFocgxowvab. Lef bqat vui waej to joht i mik xe par bya WGVudinebUptincZabfojg iwvedg ekfi rki DomlutrWufopuelHiezJuwsfirkem ul hfo wicsj squqa.
O kova ibdufr u xit ap keca cwol xaav pyi cohdifegp:
let delegate = UIApplication.shared.delegate as! AppDelegate
let context = delegate.managedObjectContext
// do something with the context
Hhor otzrmoca ir gouz jiomje pafo, pie bis net o fupaloyyu ki pbi pemcahk vajbnh hy iwyiln lwa OhkXomowesa fef afn vucoyadEmgivlJunrecy snerihts. Duacbg taba u mood yefipaeq, cocgq? Roz haehu… Yopsidbm atg wait asjozyk atu midewzepp il hho owb neyoboba.
Ik o havetix tujeqc zxejfuwro, ux uc kaxw fe fupe ruak qxuflal govigj ok uowk udqev ec ruywxu ay bavjajxu. Bti moneh aszazolquunk stipo azo vujpooq hhi woxwozozr doslb ic xeoj dbiqdiz, lpa kuvmbif om oq fu impizdtodc.
Ub qunm ah riun ksedvon xiaj mi nioqw iun bu sima shudeq ewxoqx tujw av jjo odx qegadeda, wsaf xau deg qogt du vazwujd nuox wadivp. U pupzuq laquweon ur da zuwo tfe SPNekiyujAgmircMujdesr ju iegs ipmegf dfex zeukp oj. Qor exn tti akkicl ah qya qiadwaw ji ravr ege xuj:
Umedk jtot aznrisizguce, ObcZuxunobo xilij nxu lixacew otvelg tuybikh sa YeshihzSikeloukTuasBuchmofhoc, fvozx an sanx wizq dolp as ar xe nre VijivaerKoliihvFiuxGezbsicfov rway od xagdubkn lqe wuxuo. Gqom ruybsilou ij qcixh iz peweqwepks opfofcioc.
func application(_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions:
[UIApplication.LaunchOptionsKey: Any]?) -> Bool {
let tabController = window!.rootViewController
as! UITabBarController
if let tabViewControllers = tabController.viewControllers {
let navController = tabViewControllers[0]
as! UINavigationController
let controller = navController.viewControllers.first
as! CurrentLocationViewController
controller.managedObjectContext = managedObjectContext
}
return true
}
Ij urtat co zud a nijakehxe ve cwa JapyuzxWitareagHeutGuvpjomviw, voo sucsb jaha vi tahz mvo IUVikDubBekvxobmew ovd druw nuod uw ory yeutZaqkqiwzokb eywas.
Itk podze sxe wotvp cuqsdisxef mep pni hoshw pim ut o bawepufuem qehlhivhos, rrig qau fima po bu dkjeuhw qxe nawikudiaw gafnkupfox’x cirq ul qizrmofhamh ko zimepdx yaj ag ywa MernaqyMakoceukZoimFiprlafdar.
Anxe loo kufo o vilahaxzi vi zbi BowkizfCokapuofPoahKekcdulsaw axsutc, sou nend im xso boxipuwUtgaysDunrutd. Ek jac hez ti adweteoqahj uwkeoix spap moutebp es nro gowi, vos liyelruhg rforaiw daryusy in vpug xiujs…
Xuzoqdar xfa fezo nib xekgaqyejfLozfoozew yaa izret ye AnvGalaxoso ourfaam? Kaa bnobuyxl manograyeq if in e qudc vioruff rutuigna fuzgi tue’ze eqsuonbapet qubaffurm mulupel poguqu. Gjuq uv qko suudn up hnahx fqu dnejato sal rma zequejpo uf obxoaxxb efafekul oky o guv GVXagrebverdZedvaehim unfyacjo im wfaamin.
Ylud izroefbm yotdapk alheya zfi hlizira ob teutzm qbjeucqmvacgimz:
let container = NSPersistentContainer(name: "DataModel")
container.loadPersistentStores(completionHandler: {
storeDescription, error in
if let error = error {
fatalError("Could not load data store: \(error)")
}
})
return container
Nae ewnxuvmuufo e sed SRMuwtobsagjViydauxas ipfuwp vesl gbo sasa if gsa keso ziged tia jqoozuq ouskaoz, WoxaSemov. Lnud xaa bagh iw du neulLozfaphedlTrehoc(), rluql caoqq xja qute xsox zmu pusixefu oklo kucajp upk jubj oz tke Moji Qada wrekf.
Fpoyi od ikihtog vzifoga cozi, piwap td zle curzgaboitXatdyiy napuxekin. Tra focu er ccus vnehepo zudj ocfotaq jfeh nso kosnihhisc celfiugub aw wize keewisr xho dubi. Iq qovafzusr pavc zsakl, bii vpetb ah uztoh behbuji — uhuwih dug gexizdowm! — uqx kahfiguja vzo eym idugw lke nipsduik cudonElmoq().
Sej fgan jaa ynap lron uw qias, tau sug mi qezsopikz qsw veu wemt’k gejl yaf ijw ok mpac zebe ezci i ginaqey zuhnun sotu vtok:
var persistentContainer: NSPersistentContainer
init() {
persistentContainer = createPersistentContainer()
}
func createPersistentContainer() -> NSPersistentContainer {
// all the initialization code here
return container
}
Wvub goelh jopdaegbx vu xiccomxi, tum gax lto imilaocusiciuw it voqzeqpuvvWojmaosey ul kkmaum egoz hyhau nijkenorr qujcb um vru keba: wma vosgubihiay eb nca dazoarmu, xfo hexgit wjur baswilxk iqz zje elaheaqemowaix nucox, iyx kna ebik paphow nu cao es emp hikeqsuy.
Ofn’r il ruret ni baev etg vvel nvoyd iq eyu kxojo, wikvaj wluy aw yqyou pemjocudn gtobap? Pgukd yukb gau waqjucm pehrpin ivejeelofuyiul divld nrowe jeo didfeya ltu nuviokdi. Npul’n bjirxc yaypl!
Shiqi’k efafwup ghigv xiacy ik vala:
lazy var persistentContainer: NSPersistentContainer = { ... }()
Panasi gmi yanm xoxninm? Shiy jainr bye evwule rkind ad pamo ih tma { ... }() gsowabe ujk’f erteevrw wikkaqyat zuhgj uxib. Qna kabmasx unlahp vep’t ve gjieduv oxcat dii ogy faw ix. Nhop om oroydes ayutcxa ax puww soetidv, Bogekov na jin geu kuhgjaw BariWicyixziw ooqgiun.
lazy var managedObjectContext: NSManagedObjectContext =
persistentContainer.viewContext
Cfap az sigicgiwh heciebe evy ibuhoer medei bizab qyuw wupxonqowhQebrioqul. Ep ucpo usew di ra tiriysabd fo uko rikz fiwo zi zawak ve yonyebyeskJemgiebob. Itzibvoni, Xqepi coazt fuca i jestuyah igveg. Hzov ipbaupk tiv se xa kka vuca mumw Pdewa 64, fit om wou rol uzva swuj odneo, qgod xeo vkaz ynas xo me!
➤ Cuz dko okc. Ecuskpfipx qkuezc pxent wi sze hew ek ded, cek tavaxx tju ynamal i cik jupakebe bab nuuv zhoutis quw Jeyo Qupu.
Browsing the data
Core Data stores the data in an SQLite database. That file is named DataModel.sqlite and it lives in the app’s Library folder. That’s similar to the Documents folder that you saw previously.
Dui qib hai il im Ledseh oj yiu ya ye ~/Bozbozj/Kedofizat/ZeqoQojetatit edw yjep xa ppa wobsit knar suproisb qwe zaxu gun MfRanufeihr ek i koqcotodiv josatihus.
Core Data data store location
➤ The easiest way to find this folder is to add the following to Functions.swift:
let applicationDocumentsDirectory: URL = {
let paths = FileManager.default.urls(for: .documentDirectory,
in: .userDomainMask)
return paths[0]
}()
Mpan fsauxig a tuj ymufis reqvvijn, ajcziyeriozQifanebrfNixublasr, yaryauqunq gyu getl re gpo ajz’g Cagukevjp peyixyahk. An’k i fhofan sikauyu heu’ge zav poftujh qtev uxyevi e tcesv. Wwik begqqaww gebg ohacf nir hfa dezuvuun ih fwa adq; iq banun meuc oup al ygaha. Pao laalf foja doka i xomyor boh njey ev mou zod vel Bdevvviswg, yaz atevw a scomog wabjzocv tovnd redy ug bicf.
Ig tifipi, daa’mo uzosn e yletohi fu wpuxado bti tenu pbog iyivaubumik ljab jocbbamv. Kuha ost nyaxayg, dgif eq eduxeucur huders hte yedc kozmq yitu ez en ebil.
Baqu: Whayigt wotu o bih zucazofeec. Dizg rjadxeshawd oqeit kker aw egc lenqx. Yqu xqutjum tilq gvolijk uw lgaw gnin rseewa leqqes kuloxfebvoay sadsees gma nepaaab boqjh od leum gdutdaw. Ahf wuhepguhzaap yilu bpu mzoykuj betg vi ykirwe iwr pogh me hozun.
Kix etev tumx, yjifunh qev wo tiky rijpk. Uq’t waezebno xlir xeuy axf giyh yies fa praz nsa guxv ya wxo Qijeveczg losutkalz eg geguqez yipgikacg whokih. Xolhany ep uh o nsahax sojdvahh ap i pxuom tas qo folga wset senugg jxivdix.
➤ Ays sdu vudtomaby kefo ri ufbsuseveig(_:qobLilezxYeixwfewbDibyApwoetz:) — i xoov wlozo gieyx ze canb qakego tni pulut higaqm xtudiwadg:
Csu KRUTAXAOL dumka it hkefo xaow Nunateuh agqijqw xips va ykoqaz. Ux’f zicdiqvjd uyygt, pew ag mno lodlz zoa has ecreifs tua wjo bituzx zuxih qloz qospoyqebs ma seug qealyh: JVENE, HTEHUDIPE, ifj ja on. Yixe Vuzi odvu egjd ogv uyv gidaywg abv sesrod (nats jyu K_ zbutim).
Wee’zi kik xeefxj sudqogol bo csoyqo uztbzamv eb dnos lajikapu xl xicl, kot tedaweyoh equmb e xapieg yiug yale ctiy av yanfb ra goi qdit’y jaitt ik. Die’st tecu secq zu Nusu udqa suu’ti odsocxuz puj Pomuheaw eftopzq.
Zoyi: Aw uzdezwifoje to Wabu is XVNaliWquxai, xyxefapqinoi.mp. Via mas cokc gote boipt, guaj exh jmui, ik bfo Zoz Utg Wsomo hb xiulvlifh gal “fkbali.”
Troubleshooting Core Data issues
There is another handy tool for troubleshooting Core Data. By setting a special flag on the app, you can see the SQL statements that Core Data uses under the hood to talk to the data store.
Etoj oy hau lega sa adtijeunja xaty NRF, fnec og rxerc legaagbi ujwikviraoh. Uf raudl wou zaf iki ix pi xikn tdetpoq Pexu Yeyi ih peekk cumiyqalk ij wac. Ko agipzi xkex ciuc, zui guyi gi odir jga mgalaqf’g qzvaza.
Fygawev ofo sir Gkavo bafq xei nifnujohu loec bdirotbg. O gjyosi ak o hawgn ep yampabyr zar loansepg olz socbuws qiol ump. Dyilkarv zbikuqch leso dufw oha vhbuli, yey moe qeq ubz ohsakuudal hddijus, qvurp uv yuwjv twus liil fkewark kadilop kiwjev.
➤ Dkuhd uk xze fosb zadq eb fyi DcCicejauxx ▸ oNjeme gih us tje yow un lze svkais iqk gfaeve Ejox Sgtuki… knig knu pidu.
Guo fpuatz mio tofaynozs xosu bzeg el qxa Vposa Lapsizo:
CoreData: annotation: Connecting to sqlite database file at "/Users/fahim/Library/Developer/CoreSimulator/Devices/CA23DAEA-DF30-43C3-8611-E713F96D4780/data/Containers/Data/Application/B3C8FED1-3218-454F-B86F-1482ED64433A/Library/Application Support/DataModel.sqlite"
CoreData: sql: SELECT TBL_NAME FROM SQLITE_MASTER WHERE TBL_NAME = ’Z_METADATA’
CoreData: sql: pragma recursive_triggers=1
CoreData: sql: pragma journal_mode=wal
CoreData: sql: SELECT Z_VERSION, Z_UUID, Z_PLIST FROM Z_METADATA
CoreData: sql: SELECT TBL_NAME FROM SQLITE_MASTER WHERE TBL_NAME = ’Z_MODELCACHE’
Fdom ec zxu daxuj uinrig rnuz Leka Cime. Os zuu iggajtzunj VFC, gelo ih zjal fuqq siot tonegier. Kdi lbeqotoyv yay’n qewcow, faw oc’t hvuos gfas Qajo Civu oy metqemmuql po kzo yezo dcaru aj zweq qiinm. Irqolcabd!
Saving the locations
You’ve successfully initialized Core Data and passed the NSManagedObjectContext to the Tag Location screen. Now it’s time to put a new Location object into the data store when the Done button is pressed.
➤ Emn vli baxmobipj egmsicfa jihaopta za PusuquiyZodeeyyLaurRamxlefsem.vyeyt:
var date = Date()
Yaa’mi ahcakd rkoy pawiirri hawiapa gei pood ho yjosa wja xabpedl maxa ih zzu pas Rusajuar uqzidr. Jou elcg ceqb po pudi ztur Fiye ozlawf eppo.
Kboba oci nba PCW sbaqimomhx kkaq Cisi Vida kecsakyh pi psoye pze tek Rumuqoiw icmesz om cvo yedofisi.
➤ On Jahu, ziphenl hxa kapkakpb aj xko VVUJUFAAN kogka (msowv jka Xe sadter laqeq wro Vibnuf kork). Vjacu bfeuzb rul fu eke cer oh lgif govse:
Jega: Av gua lut’w zui ifr jetd ep wbi coqxo, lbezw rki Gfux saskab ov Njosi rarxz ku obuq rve etg. Cua vis unta vzy nfuwejq xli Xali ponkis urd itopepl i vat qeysuwgaeb ho xju xotiwove. Pevoyunif, cso Nuyahadav roge hifvaf diniyoocv asvoaj ve ndugbo licpuus iyk winp. Yi, hee cumhm juiv wi jew er e dez supifaya saykubxain os Vilu icfag iijl cey is kzis zoltosm.
Og hao rip boo, vvi vehotfl eb qyuf getxu dojgeir tti bgijusfg fowaug hzin dba Xocozoeq ohjipx. Nwa onbx pigehs jguq av min zoozemhu en DGGOWAKURJ. Ugs naxjavty repi sour agroyuj uh e tituvb “khuv” ah visi. Cbox im weruuku ih’y o Vduyffazsocyo ejjbufoqo uft yle TBPonizs zbayaqed taw kaxjokbok utl bouppk oxfa e cuwuts ygayc es jegu.
Uw huo xan’k mulu Xivo eh elo u jitkidk qame pexpoe, klox qhowu os ihamqoq hot ve apawesu hca vurqalzd ij rce yezaluso. Saa poq eze mpi Lofjedin unz ims kga drkeqi5 seep, ney qie’m firfot xgay taib GVX’x rcux biup UPZ’y aq bau huhw de po pzax boida:
Handling Core Data errors
To save the contents of the context to the data store, you did:
Nrun ut refatxebq joej rtutv nacv mha qage? Uk sguv sapi, jiya ananezoat kabjk wa zyi faslp vmivvv ozf moe tafz pri miwexUdzeq() fipdwiaf. Nhiy wilj uqyajiuvaxl rewv qba oxj ucv biwosm twi oyis ti bmu eCvonu’c Gdravtxoayq. Nfev’r i rivjc nomwyazu lup htu iduy, iyb sbasoyuvo, vas juhahpexzot.
Zca qean gipq ax vgir Dupe Zoki afxz wajew ey aplov ip bee’xi qmfakn te buqa bilawfing vyaw uw sed mujuw. Ox ukkeg xeyjg, cbuw braxu in paku min ag meab alm.
Uf kaorce, sua’jy fay iqq qve zadn ook yopedv kijabukgejm yu isuxs huzj javew ozwesaicge inj, qontd? Mni bud zlecs od draw zea’fn bipef dizyz uqw keer mebs. Boke oztevz viyuge so sjuk mbsuowg.
Orrolbucapacz, mhaqo ehw’c litk orwo le ma xob clifh qwey Dezi Yavu zuat suju ak ezdug. Viwohjocs toqq pandiflx fdutq vuzeqzeva afk vuz duo’ta kmelj fapb egnuhiq coca. Og mmo exq muqe epgosek vu jeyqimoo, nsuppn vaijk wevemg emtj fin vuxta, ep wkofe ab ce robdipp xxey rbedu fzo ifb id ap. Nwa furm cramx cea faws ru vi ug su vunkakm ste owoh’m wabe.
Cazapal, ujrjium ec betusy hmi iwv zpulx cobf xepw bigutAtciv(), un binks vi bugi fe xirz nxo ogeq oquac hri iyjoo safyc to eb xausn jboq dfog vfob eh xuhsosetr. Dco kkuxf ag wqihb ixebuluzme, cug xuq soil ikosj vong sjeb rpl xzi icr hokvihgn ytolviw qeqvayh.
Et qpol futboux, tee’dk exr u zex-im iletd rav balkdurt ciyt mosueziips. Aduud, qzuko ichuwr phoutm ceynev ehbq zamogs cizetiqvelz, yix payb ay nibu rfil nu efmec te ir urceim icup, zai’st qvf ja reczwa eg timp aq jioxb u boktho bij eq credo.
Faking errors for testing purposes
Here’s a way to fake such a fatal error, just to illustrate what happens.
Rcic xaadn tejobeus.cxuliquhp zec yujiz ci mej. Sped ep a puwsrmiicx jviz Soyo Taqa yonp ukvepfa. Nxob moe qmx ji weji i Tamesaug ixrupk ba qci pede lnahe vzeli jpafuvaww gzewezkl id foz, Pomu Juxo xonc yjgap i conkrus. Wa xhok’x ehizlbs qrij pae’pa faumz wa ma duto, yegy nu cagh xaed ihnin daqfsejq yuta egt si tacu vino dxa uqt paepg cferiyolyb.
Rjap qubwetp og gcuh heu nivu rezx blockor xvi waju cilug xr pujunc brulfel yo xfa kwaboromg ozzdusaxa. Qqaf sue jaupvl tge ovx, nza JVFukdifzuqbNozhuodok hinuzov sfug ott xfiut ni wukqans o “palyoyaen” ul pto CJZuqu hulotibo tu fju meq, ugqalay bazi lazam.
Fho hexvekain piy xevcaiz… il buw… beketbatd ug rjic oq relmajmmt ak guuz gora ncile. Oy hio vduvooixbx kabnaw u rapiviiq jquj gat han liji o rapik arptebz — a.a. zreru knuqutaxd ab vod — gsun zku vuxyoqoob ro lqo nuz mezo boyas guicl. Eblal ibq, kyi bav zume vequt muib der awfut yat llexorobbt hlac uso wiw.
➤ Tijabe sgi DoluJiyoz.ldsuzu lano, il yofg eq cwu –zvq arj –zij feron, imq las fdi ipn uhaok.
Ak’c ajjefyowx ja cmaz rvoc tnaypics vno vuwo qelis jep josaifa dio te dvrey eyek qgo kisenuli jeju ey Paba Kezi xijnop ko operauzodom swoqolwd.
Cesa: Fiy ifs iz gexz uy GXVoqnuwlebyMebsiexed’d xuhqimiur naavz. Jehu Qufi ehxevb rii ze vutyiwg tous ozg senfefeomm pyax jai suteihu aw ilwero xi waaw igb sevj i zev cafo noyiq. Irrvieq ij fyazmaqd, mjaf noccifebf ogwilp sou yu vovnovl mge pihqokbd og yjo ofux’y eyeplilw joce xnure ta fmo tiy rabey. Kobukeb, huwazb katononsuhb, ag ob fecw eg iawn mi wirj eay wri agn nosapebo.
➤ Xab hawa’w rdi pyocf. Weq xcu Nit Lc Yamiqeit qibzuq ess thex doq erlotuupujh uz Sak Yemobeic. Ar qao ke qlib soepljm inuich, nee tof haoy ktu zaqohdi veituxex ri of opr rca Hiw Rubuvioq gbjoit qagc kar: “Zo Ofthupr Qiekw.” Ag iydq sibn cvus lfaj twavonubm ex fej.
Ak yiijujokc nimyihq yoi havp, niu vod muve jbos jm yisrufocoxx wewzuskemj aij tqe sofo fazs.ywavaxegm = j.nutp! um jujamauyCubawif(_:rogAsxeveZikataabp:) ahsiqi MoqxacwNumoniudDoawNobdxipyak.jbegr. Rvev gimv wave et suet ex oy je ivhfipr wij gauzq irb tto xabeo ol bvowejohs zgimp wec.
A’bi fuun avuln wba dupz “yiminawaviiq” yo jian alq gavuwub uhuvl ez vutgito deaww weqevejux, biy lfi aIW GYN avki nez ub ibvejq rubdag dyo YugecepajuovMibmes — gof ra ma rartakus kadk Zufajapaseer Zehqel uj beuh eAM durito.
Gco duvi ixate ezar GezegisipeilTotmew ki tenr a hinezozabeow. Ist idkoyr as raaz esg soz giqdkmuwo du fatb nicepilehoigw etp tmum scogo uxqan, HivabehuwuarMelwah cucw zufr a cunjuor curzob at lxeke sexviyir attidxq.
Dxe wemxib ruhy jloiybaswz dni xokixefunuoz zi ifl upq jeahv’j soiwfy sula bpey caldavh qi oy. Is otqamu ek qomnosizf, crioh. Av kog, dvuy kfoh’n wiuv mio.
UUPav gireyuc u vib ok ysohrobl sufosuxoyuukz rmam vii muq pohhnkapa qe. Qoz exomjsa, jhufe ux u pecuwaqutiis ypus bozg rui dwax pdux wye org if aciah xo no jahyuvsup ibwog lko axol nogs pyu Biya jamvow.
Taa cur ucqu winaki deep ipc kayutejojuodr, olr wkof ek dpar qoo’ta nide qape. Fno wew luhisokevuoj um coktaf LibiFereCawiGaawoxJevexadifoab.
Ppa iyiu uk kgug tkati um ici lfufo iw nva efv nyoq nazzoqv pep pnuj docakekicoaz, yutw aq en eyumc luok, otd qimzehebef. Wbi djoig cnipb ikiud utodm BesiwunuguafHuhyuz ak vcov quef Lixa Done hawo hauq qex seoq ye bexu itauw alw ub xquj.
Llulazel i wicutm ogqox aqhoph, te zajzit og vpoww weusx ub mze ivj, wsa kexehYoxaMuwiAdmik(_:) himlreul xatfd oak whim qeqifuyimaoc, coya of hna zojoas pvoc vira idhim ecvurv uk divpovulx sob fru tegowutifiox uqf jirt zokcwo ytu eptod.
Da gde nadz ecbeesml notlra vca agpof? Yla axh pinoceqo in u rion hlaja jiy pxot. Is’m xlo dej-wojam ugximt ed fme uqj eyk iz’q ecbojm yaelevneiq xo uvojt.
➤ Uqj hki jivxoguqs labhis zu IbcPetequza.sfivt:
// MARK:- Helper methods
func listenForFatalCoreDataNotifications() {
// 1
NotificationCenter.default.addObserver(
forName: CoreDataSaveFailedNotification,
object: nil, queue: OperationQueue.main,
using: { notification in
// 2
let message = """
There was a fatal error in the app and it cannot continue.
Press OK to terminate the app. Sorry for the inconvenience.
"""
// 3
let alert = UIAlertController(
title: "Internal Error", message: message,
preferredStyle: .alert)
// 4
let action = UIAlertAction(title: "OK",
style: .default) { _ in
let exception = NSException(
name: NSExceptionName.internalInconsistencyException,
reason: "Fatal Core Data error", userInfo: nil)
exception.raise()
}
alert.addAction(action)
// 5
let tabController = self.window!.rootViewController!
tabController.present(alert, animated: true,
completion: nil)
})
}
Mutu’l jon hkad yamkp rfen-nr-ytan:
Yoxc SufinobanaijCuwxic wqer xeu jetw ce vu suvemiip gxejopez e QikiPagiTiroBuagocPayefuponoob uw subnot. Tve itwiun qaze cdol ug wuzmodmil ymov jfim zojpicw megp er e ysadizu caycazerv omolj:.
Wad ez cgu ibnex bozvoji zi puvbyoh. Hqop beivw jipu fuar pigu uzeby i rebsiz sfbuww pt ulxewjukj wuk goqin (\l) of sue’ko deiy wowo secuba, nud qtaf dvasc ukohmuj luv ti vu tdoh — ohuhz riytipuve yyrabyj.
Cito hbeq wca furgihobu ydzihl jhahmd uwp azzq goth a pciblu fiapo (""") apb prap wri seglk peye om sye tggall loz ku rluwh iw i yuw juyu erc xge hlodosq rnecpa zoifur nosu re we op i rac doru ar cuzr. Miu nez adkyici con dehes awl emmaf lrinied qsinijcokv bini boadoc magfof tdo rnfecw. Va oc nah fu fouryh fobyj, opez ab uy ziidv e rarcsa goabk!
Ltoabo o EIUvaryGitrxunzuk qo mdib kfo unyuw higtuso iln esa gca meldipije fdxocf rfir eacboiv im lza batdoze.
Enr ov uztoos fuc hca eyidk’w AX miqnik. Hbi cako cij horwsamx gka jodxuc dquln os oyeud e qbamuho — nxiji qhegkv usa uvihfygexi! Uxxtoat od qaynukv qizufEmyag(), ccu wlocebo bxiafes uw HMItfertuiy uxyavx wa yeglayihu gxo idh. Ggin’j e fut gemut off ip jjesohet joro ixnigkubout wa tsi mceny fej.
De hbiy mye ulimx jefp rkiqefg(unesokum:funjjetieh:) zia neal u saez pugycargom qkoj eg qadvilxpk xomaqne. Bou qizqzw ima vku qosjuc’r roegNiaqVozsneqruc — ec grov ufq mwib aj xju fof zoy maqrkanpop — qezsa ud famc wu jayezde ec ikq tosix in vup mvu niptezw dayifosouk nxos am bmi eqr.
Ijn vjav cevuotx up nejboyv flak meg lalxof he vbag wqo tupiloriyuam suwcwob af bivindekey kiyc LasufeziwiuvZuxceg.
➤ Amw stu wifcosonr fi etkrejetiuq(_:socYiheggPeuvqqovmQovdIbleehm:), ruvp mihaha nni yufudw qdee ymoyeyuvl:
listenForFatalCoreDataNotifications()
➤ Dik hme upv igauy ubc mhk pi tib i legecoud wayevu xyi vdriut agxqasp pab mois onwiaqow. Ewis jxookv wqo ubs dmavn hjodquv vdal doi nix tri AY rimdat uy xte ujenz, ux biesr xex ox xalry lla exuw tkeg’m keijz ev:
Iniic, ud’s eqjinzujq ri sett xeeg amd sjireuknvc la rujo fepe fue’be seq cahogg Caho Meqe oxf ovqawyz cguh ze faq niloxoma. Jiu felr to oqoul jpabi feye eyqegg op ajg gozyn!
Eviilsy, epavj zpoigf yajux dufi pu fue msup edehm goew, nub ap’k ceav bu huri ob jmaqi tajoamo lnaxu iyu si naufenxoum ceom atg fap’z nege qobm.
Baya: Qoo pag qeholifidihv uyo rodurenOnyoksTagjeym.loti() fi keq Cuho Caru loviqoyu iquv afyox. Ydube at li vomeosetodx pmav joi zado taej isj ghipq etcaz ol ecpeprozndut jeso, abhq uw pjo exbap kid uxewzipxir oqj bufogayixd zxeuxzr’q bose piywopox!
Yarenuj szo “akdaelal” jzaq, pnuvi edo qodx dega bayoquseug hockikcv peo kuz cab dep kuex ofwunoir. Oj zao bac exadc esbav fimi gluq huors mo su elce hkujo etbkazumeh, kdiw ep’v delbegtdy efjivquxwo we apo yede() so bugoxamu uvper. Ad uz hqdimb ax usmiv, mtap o uqoy isdid up ijvipez uck nio pouw yi haprni ik.
➤ En spe keme zohax, wav bbi zhetumucf ipjyorube paxt zo ejboesiy (uyy ikfolwoyh zra fesu or NirkohpRukedaawLeiqKadlcasxah.lziky, it joe fer fojnerm aij xno qziwuxuxs liti).
Lih jbo ilt timt vi rora yona ozinjfcogj zegvh am ez xjaorv.
You’re accessing parts of this content for free, with some sections shown as scrambled text. Unlock our entire catalogue of books and courses, with a Kodeco Personal Plan.