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

orange breakpoint in Xcode

While I was trying to debug in Xcode, some of my breakpoint turned to orange instead of normal blue color, and these points never got hit during debugging. What’s more is that whatever change I made to the code, it  doesn’t seem to compile.

Then I found this article about orange breakpoint, it suggests to disable Load Symbols Lazily in Xcode Preferences Debugging tab. I didn’t want to change the settings, so I just made a copy of my .m file (the one with issue), and delete the original one then import the new one. 

Everything works then…

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:’