简体   繁体   English

尝试Catch Statement在Simulator上不起作用(但在iPhone上可以使用!!!)

[英]Try Catch Statement doesn't work on Simulator (but works on iPhone!!!)

I have an Exception catching statement in my code, like the following: 我的代码中有一个异常捕获语句,如下所示:

@try {
      for(NSDictionary* s in users)
      {
           do something ....
      }
 }
 @catch (NSException * exception) {
      NSLog(@"APIRequesetBase readUserInfo: Caught %@: %@", [exception name], [exception reason]);
 }
 @finally {

 }

So this try statement works perfectly on the iphone device, it can catch the exception. 因此,此try语句在iphone设备上完美运行,可以捕获异常。 However, on simulator, it can never catch the exception. 但是,在模拟器上,它永远无法捕获异常。 It just crashes!! 它只是崩溃!

I also try other simple try catch statement to test it, and the simulator can never catch the exception. 我还尝试了其他简单的try catch语句来对其进行测试,并且模拟器永远无法捕获异常。 It just simply crashes!! 它只是崩溃!

This issue is so strange. 这个问题真奇怪。 Does anyone have this issue before? 有人以前有这个问题吗?

Or is it because of the setting? 还是因为设置?

Thanks 谢谢

这是一个已知的错误,将在以后的版本中修复。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM