问题描述
我有异步事件的大项目,有时我有错误
[__ NSArrayM insertObject:atIndex:]:对象不能为零,
但我不知道哪里是抛出这个错误..我怎么能抓到这个错误?我在我操作insertobject的地方做了断言:atIndex而没有..
I have big project with async event, and sometimes i have error [__NSArrayM insertObject:atIndex:]: object cannot be nil, but I havent idea where is throwing this error.. How can I catch this error? I make assert in everywhere where I make operation insertobject:atIndex and nothing..
这是堆栈:
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[__NSArrayM insertObject:atIndex:]: object cannot be nil'
*** First throw call stack:
(0x34c352a3 0x32f4597f 0x34b7f8d9 0xc48db 0xc3ced 0xc3b41 0x1178d9 0x148aed 0x103cfd 0x102fc9 0x101f95 0x35f25595 0x35f7a13b 0x35f7a081 0x35f79f65 0x35f79e89 0x35f795c9 0x35f794b1 0x35f67b93 0x35f67833 0xd820b 0x35fc8275 0x3604aea9 0x326efa6f 0x34c0a5df 0x34c0a291 0x34c08f01 0x34b7bebd 0x34b7bd49 0x350b82eb 0x35f5a301 0x62e45 0x62de0)
libc++abi.dylib: terminate called throwing an exception
推荐答案
检查代码崩溃位置的好方法是:
A good way to check where your code is crashing is:
1)转到Xcode中的断点选项卡。
1) goTo the breakpoint tab in Xcode.
2)点击机器人的+按钮tom。
2) click on the '+" button at the bottom.
3)添加例外断点
a)在中断选项卡中选择两个:
a) In the break tab select both:
i) on Throw
ii) on Catch
和build和r
un。
and build and run.
4)这些断点将准确地给你你的位置应用程序在90%的时间内崩溃。
4) These breakpoints will give you exactly where your app is crashing 90% of the times.
希望这对您有所帮助。 :)
Hope this helps you in someway. :)
这篇关于[__NSArrayM insertObject:atIndex:]:对象不能为零 - 如何确定错误在哪里?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!