terminating uncaught exception

Discussion in 'iOS Programming' started by italiano40, Feb 21, 2009.

  1. italiano40 macrumors 65816


    Oct 7, 2007
    ok i keep getting that message on the debugger, and i have developed on Cocoa for mac OSX never for the iphone but for catching the exception i used try{

    @catch(NSException *e){
    @throw e;
    how can i find out what line of code is causing a exception?
  2. eddietr macrumors 6502a

    Oct 29, 2006
    In most cases the exception itself should tell you enough to narrow it down. That's usually the quickest way. What is the exception?

    Or, if that's not enough, you can set breakpoints for exceptions like this:

    fb -[NSException raise]
    fb objc_exception_throw
    either in your .gdbinit or manually from gdb or the XCode interface. Then you can look at the stack trace for exactly where the exception is being thrown.

    BTW, this is exactly the same as you would do in a Mac application. So the same techniques you used previously with the Mac will work here.

    Hope that helps.

Share This Page