ios - Can you use an NSManagedObject outside of it's context's performBlock? -


nsmanagedobjectcontext's have had performblock: , performblockandwait: methods added make concurrency easier. i've been using them -- potentially naively -- , realized there's question i've never asked.

if create nsmanagedobject subclass inside 1 of performblock methods, it's 'home' thread thread of it's parent context -- in case of nsprivatequeueconcurrencytype independent thread have no other access to.

so need performblock call access data contained inside managed objects? or there background magic going on protect me in case of using getters? (or setters, though seems bad idea...)

nsmanagedobject not supposed used outside of managedobjectcontexts thread/queue (sometime works , times crash ==> don't it).

coredata not guarantee safe read access object.

to access object owned "private queue" context, use either [context performblock:...] or [context performblockandwait:...], unless access objectid or managedobjectcontext properties.


Comments

Popular posts from this blog

SPSS keyboard combination alters encoding -

Add new record to the table by click on the button in Microsoft Access -

javascript - jQuery .height() return 0 when visible but non-0 when hidden -