Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode: Storyboard change initial view controller

I started my app with the "master-detail" template. I simply added two other VCs and changed the "initial view controller" checkbox to "Safety Culture MainVC"...when I run, my app crashes...

What do I need to do?!

This is a screenshot of the default storyboard with my two other VCs thrown in--they work when the "Navigation Controller" is the default.

Clearly, I'm a beginner, so as much detail as you can give me is helpful!! Thanks!

Storyboard

Debug Output:

2012-06-07 10:38:42.812 SafetyCulture[1020:fb03] -[safetyCultureMainVC topViewController]: unrecognized selector sent to instance 0x6b7c210 2012-06-07 10:38:42.840 SafetyCulture[1020:fb03] * Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[safetyCultureMainVC topViewController]: unrecognized selector sent to instance 0x6b7c210' * First throw call stack: (0x16ae022 0x183fcd6 0x16afcbd 0x1614ed0 0x1614cb2 0x2619 0x17386 0x18274 0x27183 0x27c38 0x1b634 0x1598ef5 0x1682195 0x15e6ff2 0x15e58da 0x15e4d84 0x15e4c9b 0x17c65 0x19626 0x22ed 0x2255) terminate called throwing an exception(lldb)

like image 385
Kevin Brown Avatar asked Jun 07 '12 14:06

Kevin Brown


1 Answers

topViewControlleris a method of a UINavigationController. You app tries to call this method and since it is not there it crashed.

In your image your entry point arrow is still on the navigation controller:

enter image description here

Move it via drag&drop to your safetyCultureMainVClike this: enter image description here

like image 72
Pfitz Avatar answered Sep 29 '22 08:09

Pfitz