ios - iCloud sync fails with "CoreData: Ubiquity: Invalid option: the value for NSPersistentStoreUbiquitousContentNameKey should not contain periods" -


coredata: ubiquity: invalid option: value nspersistentstoreubiquitouscontentnamekey should not contain periods: com.yashwantchauhan.outis

-pfubiquityswitchboardentrymetadata setuselocalstorage:: coredata: ubiquity: mobile~20bf44c9-c39f-48dc-a8a1-b45fc82c7e20:com.yashwantchauhan.outis

i have problem syncing icloud. these 2 errors above thrown @ me. don't know what's problem, setup entitlements file, , set ubiquity container com.yashwantchauhan.outis.

i start coredata stack using magicalrecord's method:

[magicalrecord setupcoredatastackwithicloudcontainer:@"n6tu2cb323.com.yashwantchauhan.outis" localstorenamed:@"model.sqlite"]; 

but shouldn't matter since magicalrecord simplifies coredata methods.

help appreciated.

ok update:

-[nsfilemanager urlforubiquitycontaineridentifier:]: error occurred while getting ubiquity container url: error domain=librarianerrordomain code=11 "the operation couldn’t completed. (librarianerrordomain error 11 - requested container identifier not permitted client's com.apple.developer.ubiquity-container-identifiers entitlement.)" userinfo=0x15e0d8a0 {nsdescription=the requested container identifier not permitted client's com.apple.developer.ubiquity-container-identifiers entitlement.}

this latest error message got, realize differs question's initial error turns out old message kind of strange bug of sorts. tried @rauru ferro's solution removing periods ubiquity container identifier. knew wouldn't work because requirements identifier contain periods, when put periods in, spat error message above. makes more lot more sense not using periods. know do.

i found handy code snippet can checks ubiquity container identifier fetching it. useful snippet check if have problems it.

nsstring *containerid = @"com.yashwantchauhan.outis"; nsfilemanager *filemanager = [nsfilemanager defaultmanager]; nsurl *icloudurl = [filemanager urlforubiquitycontaineridentifier:containerid]; nslog(@"%@", [icloudurl absolutestring]); 

another update: looks of it, stupid nspersistentstoreubiquitouscontentnamekey should not contain periods whole mess. if nspersistentstoreubiquitouscontentnamekey created kind of folder (tutorial), requirement there no . infront of name, .com.yashwantchauhan.outis not case. starting go mad here! there no problem entitlements file , there nothing fetching icloud container id in magicalrecord. starting think internal problem setting icloud in xcode 5, of course don't know. said, might loosing mind on trivial or cause headache other people.

can post entitlements file can verify how actual working version looks like. redacted of course. thank you!

refer https://forums.pragprog.com/forums/252/topics/12315

quoting response:

this changed (mavericks). fortunately you, since adding icloud, impact minimal.

you need change following line of code:

[options setvalue:[[nsbundle mainbundle] bundleidentifier] forkey:nspersistentstoreubiquitouscontentnamekey]; else. else? recommend descriptive application. have been using class name structures recently. change name of app perhaps or “datastorage”.

the name unique application actual value not important long understood you.

so changed code below...

        options = [nsdictionary dictionarywithobjectsandkeys:                    [nsnumber numberwithbool:yes], nsmigratepersistentstoresautomaticallyoption,     // key automatically attempt migrate versioned stores                [nsnumber numberwithbool:yes], nsinfermappingmodelautomaticallyoption,           // key attempt create mapping model automatically                @"trafficcamnz_datastore", nspersistentstoreubiquitouscontentnamekey,                // option specify persistent store has given name in ubiquity.                cloudurl, nspersistentstoreubiquitouscontenturlkey,                              // option specify log path use ubiquitous content logs.                nil]; 

refer line says trafficcamnz_datastore had trafficcamnz.datastore

  • david

Comments

Popular posts from this blog

java.util.scanner - How to read and add only numbers to array from a text file -

rewrite - Trouble with Wordpress multiple custom querystrings -