Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
304 views
in Technique[技术] by (71.8m points)

ios - XCode 4.2 MainStoryBoard Not Found

When I make changes to the MainStoryboard.storyboard none of these changes make it to my iOS device even though it builds. I tried deleting all data for the application from the device and restarting everything but now when I build and run the code on the iPhone I get the following error:

Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Could not find a storyboard named 'MainStoryboard' in bundle NSBundle </var/mobile/Applications/BE0CBEE9-1E95-443A-97CF-53CCD66A2D0C/WalkBack.app> (loaded)'

From what I can tell, my plist file has the appropriate information for the name of the storyboard.

Any ideas what is wrong, or how can I fix it? Right when this problem happened the .xcodeproj file started opening in XCode 3. Did this mess up some settings? I'm terribly lost.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

I've seen this happen a handful of times with the files with my students, and today I had it happen to me as well. What seems to fix it for me:

  1. Right-click on your MainStoryboard.storyboard in the Project Navigator.
  2. Select Delete and click Remove References Only.
  3. Right click on InfoPlist.strings and select "Show In Finder". (This is just my lazy way to open the folder containing the storyboard in finder.)
  4. Drag the MainStoryboard.storyboard from Finder back into the project.

My suspicion is that there is a bug somewhere triggered by adding files to the project or certain edits to the storyboard. It causes the localized files to not be copied into the bundle (I think). Removing the storyboard and re-adding it to the project seems to fix the hiccup.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

1.4m articles

1.4m replys

5 comments

57.0k users

...