CRASH: *** -[__NSArrayM objectAtIndex:]: index 4294967295 beyond bounds [0 .. 9]

你。 提交于 2020-01-04 13:50:50

问题


I am getting an array out of bounds error at this ridiculous index, which based on my research says that there is probably some code calling something negative such as [array objectAtIndex: -1] Problem is that this isn't my code and I cannot find it anywhere. I have put breakpoints all over the place to no avail. I am thinking it may be in a UITableView Delegate method but can't be certain. Is there anyway to access the value of all my int variables in the log. I can't NSLog them because I don't know where the crash is occurring.

Thanks!


回答1:


Try adding an exception breakpoint to see if this catches it:

1) Click on the breakpoints tab

2) Click on the "+" button on bottom left of said tab screen

3) Select "Add Exception Breakpoint"

4) (Optional) change Exception:All to Exception:Objective-C

5) Click done

This typically will break right on/before the line that's causing the crash.

Good luck.




回答2:


  1. Add an exception breakpoint
  2. Check the stack trace

  3. find the last method executed
  4. Log the value used for getting array value


来源:https://stackoverflow.com/questions/15391561/crash-nsarraym-objectatindex-index-4294967295-beyond-bounds-0-9

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!