Saturday, December 13, 2014

How to get rid of 'Failed to instantiate the default view controller for UIMainStoryboardFile...'

When I was trying to replace the default story board created in an single view project on Xcode I followed the steps below, but then I got the error message:

'Failed to instantiate the default view controller for UIMainStoryboardFile...'

So if you find this same error this is the way I solved it and the steps to replace the default story board.

To add a main story I need to follow this steps:

1) File > New > User Interface > Storyboard and call it “Newstory.storyboard"
2) Open Support Files / Info.plist
3) Search for "Main storyboard file base name” and replace the “Main” storyboard for the name of my newly added storyboard file “Newstory” without the .storyboard extension
4) Create a view controller and assign it to the story board’s view controller

5) Select the new storyboard and in the “Attributes inspector” make sure the “Is initial View Controller” is selected.



6) Build and you’ll probably see this error message:

Failed to instantiate the default view controller for UIMainStoryboardFile...

7) Just clean the build Shift + Command + K and re-build and the error should be gone.

No comments: