Aeolai
Aeolai

Reputation: 199

@catch not catching

In the code below I'm trying to catch an exception that is being thrown because the delegate doesn't implement the boolEntryCellViewControllerSegmentChanged method. However, the exception doesn't seem to be getting caught, the program is still crashing with an "unrecognized selector sent to instance" error. I'd be grateful for any pointers as to what I'm doing wrong.

@try
{
    [delegate boolEntryCellViewControllerSegmentChanged:self];
}
@catch (NSException *exception)
{
    NSLog(@"why doesn't this work?");
}
@finally
{
    NSLog(@"why, why why?");
}

Upvotes: 0

Views: 106

Answers (1)

drharris
drharris

Reputation: 11214

This is probably due to a known bug: http://www.openradar.me/8081169

In most cases, this only happens on the simulator. On the device itself, it usually works. But YMMV.

Upvotes: 1

Related Questions