私は3つのコンテキストを持っています:
masterMOC - private queue tied to the persistent store, so physical saves happen here
----mainMOC - main queue tied to the UI, child of masterMOC
-------backgroundMOC - private queue, child of mainMOC
mainMOC
で Employee オブジェクトを作成し、 を保存してみましょうmainMOC
。次に、masterMOC
(ディスクに書き込む)を保存します。
ここで、EmployeeNSManagedObjectID
を変数 objectID に保存しました。バックグラウンドMOCでこの従業員を取得したい。[backgroundMOC objectWithId:objectID]
この目的に役立ちますか? 永続ストアに移動し、そのメソッドを使用してこのオブジェクトを取得しますか? または、取得リクエストを実行する必要がありますか?