Application termination due to unmetered exception "NSObjectInaccessibleException" CoreData cannot execute error for

Everything worked fine with my application until I released the latest version. Now when I run the application, I get the error mentioned above. In the RKManagedObjectRequestOperations saveContextToPersistentStore method, this happens.

Below is the code in which I create the object, but next to the bottom, if I comment on one line, the error will never happen. The code has not changed, have I just updated RestKit from Github? Any suggestions?

NSManagedObjectContext *context = [[[RKObjectManager sharedManager] managedObjectStore] mainQueueManagedObjectContext]; User *joeBlow = [NSEntityDescription insertNewObjectForEntityForName:@"User" inManagedObjectContext:context ]; joeBlow.username = @"jjjj"; joeBlow.email = @" jason3@atsdfatsd.com "; joeBlow.gender = @"male"; joeBlow.password = @"12345"; NSError *error = nil; [context save:&error]; <------- If I comment this code out the error goes away. [self.restEngine signUpNewUser:joeBlow]; 

UPDATE

If you save to the next, it will work.

 [[objectManager.managedObjectStore persistentStoreManagedObjectContext] save:&error ]; 

Does anyone know if Restkit is no longer allowed to use the following?

 [[[RKObjectManager sharedManager] managedObjectStore] mainQueueManagedObjectContext]; 
+4
source share

All Articles