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.
Since you changed the rootViewController of MainWindow, you have to make sure your MainWindow.xib view outlet is set to your new view controller.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With