iphone - 由于未捕获的异常 'NSInvalidArgumentException' 而终止应用程序,原因 : '-[__NSCFType next]: unrecognized selector sent to instance '

标签 iphone objective-c ios

由于未捕获的异常“NSInvalidArgumentException”而终止应用程序,原因:“-[__NSCFType next]:发送到实例的无法识别的选择器” 发生此错误是因为这一行“[self autorelease];” 如果我评论这一行,那么异常不会出现,但应用程序看起来很慢,所以请告诉我我可以写什么而不是那一行

if(sqlite3_step(statement)==SQLITE_ROW)
{                
     pagestr = [NSString stringWithUTF8String:(char *)sqlite3_column_text(statement,0)];
     //dateLabel.text=previousDate;
     //textView.text=pagestr;
     EditorPage* prev= [[EditorPage alloc] initWithNibName:@"EditorPage" bundle:nil];
     prev.dateString= previousDate;
     prev.bodyString= pagestr;
     NSArray* array= [[NSArray alloc] initWithObjects:prev,@"forward",nil];
     [[NSNotificationCenter defaultCenter] postNotificationName:@"next EditorPage" object:array];
     [prev autorelease];
}       

最佳答案

你什么时候做[ self autorelease ]?我认为这很不寻常——可能是不正确的。

此消息意味着您将next消息发送到NSCFType的对象。

此类消息通常是由于向已释放的对象发送消息而导致其内存随后重新分配给不同类型的对象而引起的。

您可以打开僵尸来追踪此类问题。 此外,您可以将代码移至 ARC,以帮助避免保留/释放问题。

关于iphone - 由于未捕获的异常 'NSInvalidArgumentException' 而终止应用程序,原因 : '-[__NSCFType next]: unrecognized selector sent to instance ' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12119728/

相关文章:

ios - iOS 7 中 ZBarReaderViewController 的内存相关问题

objective-c - 我的应用程序崩溃并关闭,关于原因的信息很少

ios - 将 NSArray 拆分为 NSString

ios - 为什么我的 iOS 应用程序占用如此多的内存和 CPU?

ios - UIPickerView 作为 UITextField 的输入 View

iphone - 如何摆脱粘滞的 iPad 启动画面?

ios - 排行榜是游戏必须接受的吗?

iphone - 在执行方法之前检查每个 bool 值的更简单方法?

ios - 顺序 iOS 动画*没有* block ?

objective-c - NSComboBox : How to tell user has typed in information that is not in the pop up list and read it