icloud - Saving the same UIManagedDocument on two different devices generates error -


should same uimanageddocument open on both of devices, , save (using following code):

[self.documentdatabase.managedobjectcontext performblockandwait:^{     stnotelabelcell *cell = (stnotelabelcell *)[self.notetableview cellforrowatindexpath:indexpath];      [cell setnote:newnote animated:yes]; }]; 

i told uimanageddocuments documentstate changed uidocumentstatesavingerror error:

coredata: error: (1) i/o error database @ /var/mobile/applications/some-long-id/documents/read.dox/storecontent.nosync/persistentstore.  sqlite error code:1, 'cannot rollback - no transaction active' 2013-05-14 16:30:09.062 myapp[11711:4d23] -[_pfubiquityrecordimportoperation main](312): coredata: ubiquity:  threw trying knowledge vector store: <nssqlcore: 0x1e9e2680> (url: file://localhost/var/mobile/applications/some-long-id/documents/read.dox/storecontent.nosync/persistentstore) 

does know why error happens?

a couple of things...

i think saving same document on 2 different devices red herring, working on local copy of database on each device - transaction logs uploaded icloud.

secondly, may confused, don't see in above code snippet indicates performing save (unless triggered 1 of calls, or autosave happens).

what code snippet seem doing is:

  • on database document's child moc thread, run following block of code
  • and block of code doing purely ui related stuff, nothing database? thing might going out db cellforrowatindexpath - , expected doing read operations, not needs save.

the other thing.... if above code trigger save - might have issue performing performblockandwait. uimanageddocument save routines stuff asynchronously - need run loop execute before chance run async part... blocking before continuing may preventing actual save being executed or something.

i'm guessing wildly here, have seen enough saving managed documents know careful thread things being called from, , after save request has been made, allow run loop have chance it. fair, has ever been issue calling savetourl: repeatedly within 1 method, or in loop, in case async parts of saves queued , executed @ end, great comical effect.


Comments

Popular posts from this blog

jquery - How can I dynamically add a browser tab? -

node.js - Getting the socket id,user id pair of a logged in user(s) -

keyboard - C++ GetAsyncKeyState alternative -