EXC_BAD_ACCESS upon simple iPhone app startup

╄→尐↘猪︶ㄣ 提交于 2019-12-06 04:30:27

It's crashing in NibDecoder, i.e. when loading your XIB files. You probably have a reference in there to an object or property that doesn't exist or isn't initialized.

Check the name of the .xib file and the name of the initByNibName method, if they are the same. Probably, these two names are different.

I just solved this for a similarly basic iPhone app in a teach-yourself book, and realized that I had simply misplaced an @ after a " instead of in front - Meow is the one that's messed up (below) and that was enough to throw the error:

animalSounds=[[NSArray alloc]initWithObjects: @"Oink","@Rawr",@"Ssss",@"Roof","@Meow",@"Honk",@"Squeak",nil];

To debug I used the super basic method of setting breakpoints and NSLog output, so I could figure out which of the 4 variables I was using was screwed up.

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