CADisplayLink吞下异常

我注意到在使用CADisplayLink时,异常只会被吞下:
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");
}
运行此代码将生成以下输出:
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
这是CADisplayLink的正确行为吗? 当异常冒泡而不是解开堆栈并假装什么都没发生时,有没有办法让它中止程序?     
已邀请:
我怀疑CoreAnimation的C ++内部(在回溯中证明)是你注意到的异常吞咽的原因(或者更确切地说,我不认为NSTimer会吞下异常); CoreAnimation回调(在动画时从
+[UIView setAnimationDidFinishSelector:]
或甚至
-viewDidAppear:
调用)似乎做同样的事情,除了我认为他们打印了一条日志消息。我不确定为什么Apple会选择异常吞咽,而不是异常处理;那好吧。 就我所知,做你所要求的唯一方法就是
@try
{
  ...
}
@catch(...)
{
  abort();
}
我知道,帮助不大。另外两件可能有用的事情: 断点objc_exception_throw http://bugreport.apple.com/     

要回复问题请先登录注册