ios - NSManagedObjectContext deleteObject not working after app kill -
My app is trying to download json data from the BE and save it on the core data. To keep track of downloading the remaining data contents, I save them in key data too. When the data says that data is downloaded in batches of 10, then I will remove the data ID downloaded from the core data object. It works fine when it goes in the background if the app data is killed during the download, then the app resumes when the app is activated, though after downloading, I do not have data ID downloaded from NSManagedObjectContext Can delete I have attached the code below:
- (minus) removeIdListAtIndexesCustomized: (NSIndexSet *) index {NSMutableOrderedSet * IdListMutable = [self mutableOrderedSetValueForKey: @ "IdList"]; [Index Enumerate Indexing Lock: ^ (NSUnterger IDX, Ball * Stop) {[NSManned Object ContactDialAbject: [IDListMptic ObjectItindex: IDX]]; // this is where the program stops) ;; NSError * error; If (! [Ansmanedobjekt save contact: End Edition]) {Anselog (@ "save failed:% @", [error locale description]); }} - (zero) resume sync {SyncData * syncData = [SyncData getSyncData]; // main thread NSInvocationOperation * syncOperation = [[NSInvocationOperation alloc] initWithTarget: self selector: @selector (getEvents :) object: syncData]; [SyncQueue addOperation: syncOperation]; } - (zero) getEvents: (SyncData *) syncData {// .... [[DataManager sharedInstance] loadEvents: syncData]; Nsindeksset * Albumindeksset = [Nsindeksset Indekssetvithindeksesinrnge: Nsmkernge (0, 15)]; [Remove SyncDataAlbumIdlistArtIndexised: AlbumEndXSAT]; } DataManager.m - (zero) loadEvents: (SyncData *) data {EventRequest * eventRequest = [EventRequest new]; EventRequest.albumData = PostData; EventDataOperation = [[NSInvocationOperation alloc] initWithTarget: self selector: @selector (loadEventRequest :) object: eventRequest]; // Add operation to queue and let it execute. [Event operation queue operation: event data operation]; If ([[Event operation quo operations] Event data operation]) [[Wait for the applicationDateApply Endlessly]; }}
Comments
Post a Comment