NSArrayM insertObject:atIndex:]: object cannot be nil'

China☆狼群 提交于 2019-11-29 08:23:51
Michael Dautermann

You haven't listed enough code in your question to definitely show where you're making an error.

Look in your code for any lines that say "insertObject:atIndex:". The object you're inserting is apparently nil.

If you can't find this line, add a symbolic breakpoint on the symbol "[NSArray insertObject:atIndex:]" (click the link to see specific instructions in an answer of a closely related question to yours) and see if you can break on it right before the crash happens.

I had a similar problem. My mistake was in not marking the view that I was trying to load as the initial view controller. My guess is that the there was no initial view controller to add to the array and hence the object was nil. I'm not sure how good this is at answering your question but it worked for me.

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