ios - Core Data Concurrency with parent/child relationship and NSInvocationOperation done right? -
i've been using core data store ios app data in sqlite db. data synchronized central server during login or after n minutes have passed , app grew, synchronization got slower , needed background process prevent freezing of main thread. for rewrote synchronization class use nsinvocationoperation class each process in synchronization method. i'm using dependencies data being imported/synchronized has several dependent relationships. then add operations nsoperationqueue , let run. there 2 additional important elements: when generate operations execute create new uuid nsstring, represents synchronization id. used track entities in core data have been synchronized, therefore, every entity has attribute stores synchronization id. used during synchronization process , accesses each method passed nsinvocationoperation . the import , synchronization methods actual methods access core data. inside each of methods create new instance of nsmanagedobjectcontext follows: ...