Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iPhone getting black screen on app launch

I am getting a black screen whenever my app launches. There is no error message and I have set my main nib file in the .plist file. Here is some of my code.

AppDelegate.h

#import <UIKit/UIKit.h>

@class LoginController;

@interface ViiadAppDelegate : NSObject <UIApplicationDelegate> {

}

@property (nonatomic, retain) IBOutlet UIWindow *window;

@property (nonatomic, retain) IBOutlet LoginController *viewController;

@end

AppDelegate.m

#import "AppDelegate.h"

#import "LoginController.h"

@implementation AppDelegate


@synthesize window=_window;

@synthesize viewController=_viewController;

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
    // Override point for customization after application launch.

    self.window.rootViewController = self.viewController;
    [self.window makeKeyAndVisible];
    return YES;
}

Thanks in advance. I am new to iPhone development.

like image 437
Stefan Bossbaly Avatar asked Dec 28 '22 17:12

Stefan Bossbaly


1 Answers

Since you changed the rootViewController of MainWindow, you have to make sure your MainWindow.xib view outlet is set to your new view controller.

like image 108
Keller Avatar answered Dec 31 '22 13:12

Keller