objective-c warning ‘class’ may not respond to ‘method’

This is a very interesting error message, you may want to look at the order of the method you are calling, and the code that causes the warning message. 
-(void) aMainMethod{
 [self testMethod] //call the method, warning occurs here
 ....
}
//here's the method you are calling
-(void) testMethod{
  NSLog(@"test");


If  your method is at somewhere after the code you call it (if it’s like above), move it so that it’s before the code (like the code below), and the warning should go away. Even with the warning, you should still be able to compile and run without any problem. 

//here's the method you are calling
-(void) testMethod{
NSLog(@"test");
}
-(void) aMainMethod{
[self testMethod] //no warning
....
}

Here’s an article about this with more details.

Advertisements

xCode debugging error: TERMINATING_DUE_TO_UNCAUGHT_EXCEPTION

I’m not familiar with Xcode, when I was trying to debug my first application, I get this __TERMINATING_DUE_TO_UNCAUGHT_EXCEPTION__ from my stack trace, and of course I got no idea what that means.

Luckily I found this on iphondevsdk forum, basically if you see this message, there’s actually more information’s available, just open up the console by click Run->Console from the menu, and there it is, your highlighted exception and reason. 

2008-10-11 23:19:34.551 Test[1718:20b] *** Terminating app due to uncaught exception ‘NSInternalInconsistencyException’, reason: ‘UITableView dataSource must return a cell from tableView:cellForRowAtIndexPath:’