I've noticed that when using CADisplayLink, exceptions just get swallowed:
CADisplayLink *aDisplayLink = [[UIScreen mainScreen] displayLinkWithTarget:self selector:@selector(doIt)];
[aDisplayLink setFrameInterval:100];
[aDisplayLink addToRunLoop:[NSRunLoop currentRunLoop] forMode:NSDefaultRunLoopMode];
...
- (void) doIt
{
NSLog(@"Before");
// Force an exception
NSLog(@"%@", [[NSArray array] objectAtIndex:1]);
NSLog(@"After");
}
Running this code produces the following output:
2011-04-11 18:30:36.001 TestFrameLink[10534:207] Before
2011-04-11 18:30:37.666 TestFrameLink[10534:207] Before
2011-04-11 18:30:39.333 TestFrameLink[10534:207] Before
Is this the correct behavior for CADisplayLink? Is there any way to make it abort the program when an exception bubbles up rather than unwind the stack and pretend nothing happened?