[英]Try Catch Doesn't Work
我在 XCode 4 的 output window 中得到這個堆棧跟蹤:
*** 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 的模擬器中。
已經報告了一個錯誤,該錯誤會阻止NSInvalidArgumentException
被捕獲。 這個錯誤似乎只影響模擬器。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.