ios - Is it safe to pass NSManagedObjectID-s between multiple NSPersistentStoreCoordinator-s? -


i have multiple nspersistentstorecoordinator instances have 1 nspersistentstore each, pointing same sqlite file. , in testing passing nsmanagedobjectid objects between them, , calling

- (nsmanagedobject *)existingobjectwithid:(nsmanagedobjectid *)objectid error:(nserror **)error

on nsmanagedobjectcontext seems work fine, have yet come across documentation apple confirms supposed work fine.

so, question is, if knows if supposed work (a link apple documentation confirming awesome!), of if knows not supposed work, , should not doing this, awesome too!

it's safe call method. whether returns object story.

when using object id different context, you'll non-nil result if object accessible context call method on. implies object exists in persistent store, meaning has been saved on original managed object context.

or in other words, you'll non-nil result if you've saved object id, , if you're using object's permanent (post-save) id.


Comments

Popular posts from this blog

python - Subclassed QStyledItemDelegate ignores Stylesheet -

java - HttpClient 3.1 Connection pooling vs HttpClient 4.3.2 -

SQL: Divide the sum of values in one table with the count of rows in another -