运维开发网

objective-C语言 尝试捕获不起作用

运维开发网 https://www.qedev.com 2020-02-26 09:28 出处:网络 作者:运维开发网整理
我在XCode 4的输出窗口中得到了这个堆栈跟踪: *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[Page bottom]: unrecognized selector sent to instance 0xfbdb1f0' 但是,调用代码有一个try catch @tr
我在XCode 4的输出窗口中得到了这个堆栈跟踪:

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

但是,调用代码有一个try catch

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

它可能与NSHangOnOtherExceptionMask有关,但我不确定它是如何组合在一起的.如何让我的catch块工作?这是在iPad 4.2的模拟器中.

A bug has been reported阻止捕获NSInvalidArgumentException.此错误似乎只影响模拟器.
0

精彩评论

暂无评论...
验证码 换一张
取 消