本文介绍了尝试Catch Statement在Simulator上不起作用(但在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 {

 }

因此,此try语句在iphone设备上可以完美运行,它可以捕获异常.但是,在模拟器上,它永远无法捕获异常.它只是崩溃了!

So this try statement works perfectly on the iphone device, it can catch the exception.However, on simulator, it can never catch the exception. It just crashes!!

我也尝试使用其他简单的try catch语句进行测试,并且模拟器永远无法捕获异常.只是崩溃而已!!

I also try other simple try catch statement to test it,and the simulator can never catch the exception. It just simply crashes!!

这个问题真奇怪.有人以前有这个问题吗?

This issue is so strange.Does anyone have this issue before?

还是因为设置?

谢谢

推荐答案

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

This is a known bug that will be fixed in a future release.

这篇关于尝试Catch Statement在Simulator上不起作用(但在iPhone上可以使用!!!)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-14 17:52