On iPhone, I´ve tried to delete managed objects in background:
- (void) cleanUp {
dispatch_queue_t queue_cleanUp;
queue_cleanUp = dispatch_queue_create("com.aroundcal.cleanup", NULL);
dispatch_async(queue_cleanUp, ^{
while (!self.stopThread) {
[self deleteMyObjects];
[NSThread sleepForTimeInterval:30];
}
});
dispatch_release(queue_cleanUp);
}
In deleteObjects
I use a separate managedObjectContext. If I delete some of these objects from the user interface, the app crashes if the cleanUp
thread runs in the background.
The error is that faults cannot be full filled.
Can someone help?