1)

If you add two breakpoints, you should be able to debug these exceptions.
To do this, go to Run | Show | Breakpoints and create two global breakpoints
(I do them globally because they are so useful in all my applications).
The first should be named "objc_exception_throw" and its location should be "libobjc.A.dylib".
The second should be "-[NSException raise]" and its location should be "CoreFoundation".
Now, if you start debugging your application with breakpoints enabled,
it should break on the throw of these exceptions.
You should then be able to see the chain of events that led to the exception within the debugger.

2)
int main(int argc, char *argv[]) {
 int retVal;
 NSAutoreleasePool * pool;
 @try
 {
 pool = [[NSAutoreleasePool alloc] init];
 retVal = UIApplicationMain(argc, argv, nil, nil);
 }
 @catch(NSException* e)
 {
 NSLog(@"%@", e.reason);
 }
 @finally
 {
 [pool release];
 }
 return retVal;
}

3) Check the stack trace on the left side :

http://developer.apple.com/library/mac/#documentation/ToolsLanguages/Conceptual/Xcode4UserGuide/Debugging/Debugging.html

Leave a Reply

(required)

(required)

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

© 2011 W2OM - iPhone by code Suffusion theme by Sayontan Sinha