Terminating app due to uncaught exception ‘NSInvalidArgumentException’, reason: ‘-[__NSCFType next]: unrecognized selector sent to instance ‘
this error is occuring because this line “[self autorelease];”
if i comment this line then the exception not come but app looks very slow,so please tell me that what could i wrote the line that instead of that line
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]; }
When do you do
[ self autorelease ]? I think that’s very unusual–it’s probably incorrect.This message means you are sending the message next to an object of
NSCFType.Messages like this are often caused by sending a message to an object that has been release and whose memory was subsequently reallocated to a different type of object.
You can turn on zombies to track down this kind of issue. Also, you could move your code to ARC to help avoid retain/release issues.