Dan Rosenstark
Dan Rosenstark

Reputation: 69757

Try Catch Doesn't Work

I'm getting this stack trace in the output window of XCode 4:

*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[Page bottom]: unrecognized selector sent to instance 0xfbdb1f0'

However, the calling code has a try catch

@try {
    [self restoreStateWithControlSurfaces:result];
}
@catch (NSException *exception) {
    NSLog(@"Failed at restoreStateWithControlSurfaces %@", exception);
    retVal = NO;
}

It might have something to do with NSHangOnOtherExceptionMask but I'm not sure how this fits together. How can I get my catch block to work? This is in the simulator for iPad 4.2.

Upvotes: 4

Views: 934

Answers (1)

albertamg
albertamg

Reputation: 28572

A bug has been reported that prevents NSInvalidArgumentException from being caught. This bug appears to affect the simulator only.

Upvotes: 3

Related Questions