
谁能帮我?
是否在xcode项目中禁用了禁用捕获异常的设置?
Nsstring *test = @"test";unichar a;int index = 5;@try { a = [test characteratIndex:index];}@catch (NSException *exception) { NSLog(@"%@",exception.reason);}@finally { NSLog(@"Char at index %d cannot be found",index); NSLog(@"Max index is: %lu",[test length]-1);} 解决方法 就我而言,还有一个其他liker Flag -Wl,-no_compact_unwind in* Terminating app due to uncaught exception ‘NSRangeException’,reason: ‘-[__NSCFConstantString characteratIndex:]: Range or index out
of bounds’
* First throw call stack: (0x1832ad900 0x18291bf80 0x1832ad848 0x1831a52f0 0x100249340 0x188015704 0x188244130 0x1882484b8
0x1882455c0 0x184863790 0x184863b10 0x183264efc 0x183264990
0x183262690 0x183191680 0x18800e580 0x188008d90 0x10017662c
0x182d328b8) libc++abi.dylib: terminating with uncaught exception of
type NSException
我的项目的构建设置.
我删除它,然后问题得到解决.
总结以上是内存溢出为你收集整理的ios – objective-c没有在try / catch块中捕获异常全部内容,希望文章能够帮你解决ios – objective-c没有在try / catch块中捕获异常所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)