Getting the above error when my app launches. The following code is from my AppDelegate .h File
#import
@interface TableViewAppDelegat
Select your target project.Then set your mainstoryboard name from the dropdownlist in summary section.
Maybe it does sound stupid, but I got this error because I linked the root view controller with one button's event. This issue was gone when I removed this connection.
One of the ways, I overcame this was by the following steps:
1) Start Xcode and choose Empty Application
2) Now Goto the File --> New Application under UI
3) Give it a name --> myView
4) Now create a custom Class --> myView
5) Goto the .xib file now and click on the File Owner and under the Class Attribute enter --> myView as the custom Class
6) Now add a button and create an action
7) It should work
add this in your app delegate:
self.window.rootViewController = navigationController;
Swift 2 solution that worked for me :
Insert the code below in AppDelegate -> didFinishLaunchingWithOptions
self.window!.rootViewController = storyboard.instantiateViewControllerWithIdentifier("YourRootViewController") as? YourRootViewControllerClass
If you started with an empty template and added a storyboard, you need to do a couple of things:
In project settings ->General, select your storyboard as the main interface
You also need to delete the following lines from YourAppDelegate.m
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
// Override point for customization after application launch.
self.window.backgroundColor = [UIColor whiteColor];
[self.window makeKeyAndVisible];