如何知道哪个 NSArray 导致了异常
how to know which NSArray is causing the exception
我的 iOS 应用程序崩溃并显示以下错误消息。基本上,我正在尝试访问不存在的数组索引。
如何让 Xcode 显示我执行错误操作的确切数组名称(或导致崩溃的调用堆栈)?
****我看到了错误信息***
2015-11-05 09:24:38.509 firstCDapp[1165:734714] *** Terminating app due to uncaught exception 'NSRangeException', reason: '*** -[__NSArray0 objectAtIndex:]: index 0 beyond bounds for empty NSArray'
*** First throw call stack:
(0x279c585b 0x39086dff 0x27958bdf 0x923f9 0x2be38d63 0x2be38e89 0x2be28df5 0x2be3d46f 0x2bbe35af 0x2baf5cc3 0x2b3bdb05 0x2b3b9201 0x2b3b9091 0x2b3b85b1 0x2b3b8263 0x2b3b1a1f 0x27988091 0x27986387 0x279867c5 0x278d90d9 0x278d8ecd 0x30c4eaf9 0x2bb622dd 0x93b35 0x397d4873)
libc++abi.dylib: terminating with uncaught exception of type NSException
尝试添加异常断点 -> 右键 -> 编辑 -> Exception = Obj-c,这可以帮助你找到错误
我的 iOS 应用程序崩溃并显示以下错误消息。基本上,我正在尝试访问不存在的数组索引。
如何让 Xcode 显示我执行错误操作的确切数组名称(或导致崩溃的调用堆栈)?
****我看到了错误信息***
2015-11-05 09:24:38.509 firstCDapp[1165:734714] *** Terminating app due to uncaught exception 'NSRangeException', reason: '*** -[__NSArray0 objectAtIndex:]: index 0 beyond bounds for empty NSArray' *** First throw call stack: (0x279c585b 0x39086dff 0x27958bdf 0x923f9 0x2be38d63 0x2be38e89 0x2be28df5 0x2be3d46f 0x2bbe35af 0x2baf5cc3 0x2b3bdb05 0x2b3b9201 0x2b3b9091 0x2b3b85b1 0x2b3b8263 0x2b3b1a1f 0x27988091 0x27986387 0x279867c5 0x278d90d9 0x278d8ecd 0x30c4eaf9 0x2bb622dd 0x93b35 0x397d4873) libc++abi.dylib: terminating with uncaught exception of type NSException
尝试添加异常断点 -> 右键 -> 编辑 -> Exception = Obj-c,这可以帮助你找到错误