objective c - Does accessing a property on an NSManagedObject from a background thread make the context cross that thread? -


I need to use a property in the background running method as a custom on my NSManagedObjectContext. After being told, I have problems after that reference, even if whatever I did, the value of the property was received.

to:

Manipulate managed objects at any time To access, you use the associated managed object context. Core data does not present a situation where reads are "safe" but changes are "dangerous" - each operation is "dangerous" because each operation has a cash cuisine effect and can trigger a faulting.

i is working with core data in multi-threaded app for a while (in the pre-iOS 5 era, without parent references). I suspect it has some threading magic (locks and stuff) under the hood. If you want to be 100% safe, you can not call any method to NSManagedObject in the background thread, if its NSManagedObjectContext is not built on the same thread Otherwise, there may be undefined behavior (for example, I get some deadlocks)


Comments

Popular posts from this blog

sqlite3 - UPDATE a table from the SELECT of another one -

c# - Showing a SelectedItem's Property -

javascript - Render HTML after each iteration in loop -