terminating uncaught exception

Discussion in 'iPhone/iPad Programming' started by italiano40, Feb 21, 2009.

  1. macrumors 65816

    italiano40

    #1
    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{
    //code

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

    #2
    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:

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