Core Data Error: _Unwind_Resume called from the _PFFaultHandlerLookupRow function in the CoreData image


I get this strange error from Core Date, and I can't figure out why.
The code below is executed when I delete the UITableView line.
I pass the row and the object to the method below, and it retrieves the article in the database table with that row and has a foreign key for this object. Then I delete this object and reload the table.

- (void) deleteFavorite: (NSString *) link inFolder: (Favorites *) f {
    NSFetchRequest * request = [[NSFetchRequest alloc] init];
    NSEntityDescription * favsDecriptor = [NSEntityDescription entityForName: @ "Favorites" inManagedObjectContext: context];
    [request setEntity: favsDecriptor];
    NSPredicate * predicate = [NSPredicate predicateWithFormat: @ "(belongsTo ==% @) AND (link =% @)", f, link];
    [request setPredicate: predicate];

    NSError * error = nil;   
    NSMutableArray * fav = [[NSMutableArray alloc] init];
    fav = [[context executeFetchRequest: request error: & error] retain];
    if (! [context save: & error]) {
        NSLog (@ "Cannot fetch the story from the fetch request.");
    }

    NSLog ([[fav objectAtIndex: 0] title]);
    error = nil;
    [context deleteObject: [fav objectAtIndex: 0]];
    if (! [context save: & error]) {
        NSLog (@ "Can't delete the fav!% @", Error);
    }
}

The application crashes instantly, and I get this message in the console. But when I run the application after this, the line has been deleted.

Detected an attempt to call a symbol in system libraries that is not present on the iPhone:
_Unwind_Resume called from function _PFFaultHandlerLookupRow in image CoreData.

, !
!

+3
2

, โ€‹โ€‹Core Data. ( , SO), , , - . , . , , , .

+2

, ? - , . ( ), , , .

, "" "" Objective-C "". . KVO NSManagedObject.

+2

Source: https://habr.com/ru/post/1783997/


All Articles