【发布时间】:2015-02-14 19:34:13
【问题描述】:
当我调用几个方法时,我的应用程序崩溃了
我可以看到错误消息并且我理解它的含义,但我不知道如何通过消息检测出问题的数组。 我在项目中有很多数组。 我怎么知道问题出在哪里?
这是消息:
2014-12-16 15:07:01.830 myApp[2776:1237923] *** Terminating app due to uncaught exception 'NSRangeException', reason: '*** -[__NSArrayM objectAtIndex:]: index 0 beyond bounds for empty array'
*** First throw call stack:
(0x2a3eae3f 0x37a98c8b 0x2a2ffc49 0x114c07 0x2d8e515d 0x2d8e3835 0x2d8df47d 0x2d885b37 0x2d2adccd 0x2d2a96b5 0x2d2a953d 0x2d2a8f21 0x2d2a8d25 0x2d2a2bfd 0x2a3b15cd 0x2a3aec8b 0x2a3af093 0x2a2fd621 0x2a2fd433 0x316ab0a9 0x2d8e7809 0x12fee5 0x38018aaf)
libc++abi.dylib: terminating with uncaught exception of type NSException
【问题讨论】:
-
你初始化数组了吗?
-
为什么不发布你调用的方法?
-
Xcode 为我们提供了一个重要的特性——“断点”。使用它。
-
我知道什么是“断点”——但在这种情况下我不能使用它,因为这个问题只有在我快速输入文本时才会出现。
-
@vishnu - 是的,数组正在初始化
标签: ios objective-c xcode debugging swift