本文介绍了核心数据错误:_Unwind_Resume从函数中调用_PFFaultHandlerLookupRow在图像CoreData的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我从核心日期得到这个奇怪的错误,我不明白为什么。

当我删除一行UITableView时,执行下面的代码。

我传递一个字符串和一个对象到下面的方法,它获取一个数据库表中有该字符串并有该对象的外键的文章。

 
- (void)deleteFavorite:(NSString *)link inFolder:(Favorites *)f {
NSFetchRequest * request = [[NSFetchRequest alloc] init];
NSEntityDescription * favsDecriptor = [NSEntityDescription entityForName:@FavoritesinManagedObjectContext: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(@无法从抓取请求中抓取故事。
}

NSLog([[fav objectAtIndex:0] title]);
error = nil;
[context deleteObject:[fav objectAtIndex:0]];
if(![context save:&error]){
NSLog(@无法删除fav!%@,错误)
}
}

应用程序即时崩溃,我在控制台中收到此消息。
但是当我启动应用程序后,该行已被删除。

 
检测到尝试调用系统库中的符号这是不存在的iPhone:
_Unwind_Resume从图像CoreData中的函数_PFFaultHandlerLookupRow调用。



请帮助!

提前感谢大家!

解决方案

有可能是您持有对删除对象的引用,或者被删除的对象是观察者,并且在被删除后获得回调 ?我最近有类似的东西,虽然略有不同的错误消息。在我的情况下,我也崩溃删除(在某些情况下),但当我重新启动对象被删除已经,事实上,已删除。



如果您还没有这样做,在运行菜单下选择停止对Objective-C异常。这帮助我跟踪我的崩溃的根本原因。在我的情况下,它是KVO观察器获得回调的属性的删除NSManagedObject的值的变化。



I'm getting this weird error from Core Date and I cant understand why.
The code below is executed when I delete a row of a UITableView.
I pass a string and an object to the method below and it fetches the article in a database table that has that string and has a foreign key to that object. Then I delete that 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 app instantly crashes and I get this message in the console.But when I launch the app afterwards, the row 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.

Please help!
Thanks in advance to everyone!

解决方案

Is it possible that you are holding a reference to the delete object or that the deleted object is an observer and is getting a callback after its been deleted? I had something similar to this recently, though slightly different error message. In my case, I also crashed upon deletion (under some conditions) but when I relaunched the object-to-be-deleted had, in fact, been deleted.

If you haven't already done so, under the Run menu select Stop on Objective-C Exceptions. This helped me track down the root cause of my crash. In my case it was KVO observer getting callback of change of value of a property of deleted NSManagedObject.

这篇关于核心数据错误:_Unwind_Resume从函数中调用_PFFaultHandlerLookupRow在图像CoreData的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-27 15:56