MagicalRecord 中的 localContext 是什么?
What is localContext in MagicalRecord?
有时在我的应用程序中我会使用 MagicalRecord 块,例如
[MagicalRecord saveWithBlockAndWait:^(NSManagedObjectContext *localContext){}];
我想问一下,localContext是什么?是我的 [AppDelegate sharedContext]
还是什么?
上的教程
MagicalRecord provides methods to set up and work with contexts for
use in background threads. The background saving operations are
inspired by the UIView animation block methods, with a few minor
differences:
The block in which you make changes to your entities will never be
executed on the main thread. A single NSManagedObjectContext is
provided for you within these blocks.
有时在我的应用程序中我会使用 MagicalRecord 块,例如
[MagicalRecord saveWithBlockAndWait:^(NSManagedObjectContext *localContext){}];
我想问一下,localContext是什么?是我的 [AppDelegate sharedContext]
还是什么?
MagicalRecord provides methods to set up and work with contexts for use in background threads. The background saving operations are inspired by the UIView animation block methods, with a few minor differences:
The block in which you make changes to your entities will never be executed on the main thread. A single NSManagedObjectContext is provided for you within these blocks.