I am a beginner to iOS development. I've run into a weird issue whereby I get this error sometimes when trying to run the application:
Application windows are expected to have a root view controller at the end of application launch
I have a text input, label, and 2 buttons.
The weird thing is, I can fix this error by simply moving an element on the storyboard. However, by moving something again, I often break it and this error appears.
I have checked:
- my main storyboard file base name is correct in my plist file
- the main.m UIApplicationMain line never changes
- my storyboard is set to be the initial storyboard.
I don't understand why moving elements on the storyboard would cause / fix this error.
This is in XCode 5.
EDIT:
As requested, 2 screenshots.
Working: "Do it" button is seen top most. Build, runs fine.
Then, I move "Do it" button below "test". Build, and fails.
EDIT2: I did a diff between the broken project and a copy of the working project. This is what I got:
pauls-mbp:Objective C paul$ diff -r CEM1 CEM1.broke
diff -r CEM1/CEM1/Base.lproj/Main.storyboard
CEM1.broke/CEM1/Base.lproj/Main.storyboard
33c33
< <rect key="frame" x="156" y="164" width="33" height="30"/>
---
> <rect key="frame" x="151" y="198" width="33" height="30"/>
43c43
< <rect key="frame" x="150" y="257" width="44" height="24"/>
---
> <rect key="frame" x="145" y="236" width="44" height="24"/>
Binary files
CEM1/CEM1.xcodeproj/project.xcworkspace/xcuserdata/paul.xcuserdatad/
UserInterfaceState.xcuserstate and
CEM1.broke/CEM1.xcodeproj/project.xcworkspace/xcuserdata/paul.xcuserdatad/
UserInterfaceState.xcuserstate differ