繁体   English   中英

由于未捕获的异常'NSInvalidArgumentException'而终止应用程序,原因:'-[__ NSCFType next]:无法识别的选择器已发送至实例'

[英]Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSCFType next]: unrecognized selector sent to instance '

由于未捕获的异常'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 ] 我认为这很不正常-可能是错误的。

此消息意味着您要发送的消息的对象旁边 NSCFType

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

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

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM