I'm working with new version of Magical Records and have a problem. Method of MR_contextForCurrentThread is deprecated, i want to find new context instead of that, but without success, i am always have error. I'm already tried simple MR_Context and MR_rootSavingContext. What method is better to use in async mode ?
dispatch_async(_syncQueue, ^{
__unused YOUServerObject *o;
NSManagedObjectContext *moc = [NSManagedObjectContext MR_contextForCurrentThread];
[moc reset];
[moc performBlockAndWait:^{
NSArray *objects = [array bk_map:^id(NSDictionary *dict) {
// fetching from core data by path and id
return object;
}];
for (NSUInteger i = 0; i < array.count; ++i)
{
// sync relationshipsYOUSyncableServerObject in core data
// obj.syncDateTime = syncDate;
}
[moc MR_saveWithOptions:MRSaveSynchronously | MRSaveParentContexts
completion:^(BOOL contextDidSave, NSError *error) {
// saving inside core data
}];
}