I have been trying to solve this problem for over 14 hours now…I am really hoping that someone could please help me load my storyboard. Everytime I try it non-programmatically, it decides it wants to keep it as a black screen (and its not the loading screen. I checked to see if it was in the initial view controller. Yet nothing. So I figure, maybe I need to do it programmatically. I’ve synthesized them properly as you can see. Still nothing. What am I doing wrong (there is no xcode error output).
Appdelegate.h
#import <UIKit/UIKit.h>
@class ViewController;
@interface AppDelegate : UIResponder <UIApplicationDelegate> {
UIWindow *window;
UIViewController *viewController;
}
@property (strong, nonatomic) UIWindow *window;
@property (strong, nonatomic) UIViewController *viewController;
@end
AppDelegate.m
#import "AppDelegate.h"
#import "ViewController.h"
@implementation AppDelegate
@synthesize window;
@synthesize viewController=_viewController;
- (BOOL)application:(UIApplication *)application
didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
self.window = [[UIWindow alloc]
initWithFrame:[[UIScreen mainScreen] bounds]];
self.window.rootViewController = viewController;
[self.window makeKeyAndVisible];
return YES;
}
- (void)applicationWillTerminate:(UIApplication *)application {
// Save data if appropriate
}
If you are using a Storyboard, you should remove the code you have written in the app delegate method; change it to look like this:
Next look at your build target properties (in your project navigator, click on the name of your project at the very top). Is your storyboard selected in the “Main Storyboard” section of the “Summary” pane?
Finally go to the storyboard and make sure your view controller is selected as the initial view controller. Select the view controller scene and verify that the “Initial Scene: Is Initial View Controller” box in the attributes inspector pane is checked.
If all of these steps have been verified and you’re still seeing a blank screen, it’s possible that there is a bug in your view controller. Try dragging a brand new view controller to the storyboard, add a label, and set it as the initial view controller. If you are able to see that scene launch, there is a problem with your original view controller (rather than it being an issue with the launching of your storyboard).