iPhone在应用启动时出现黑屏 [英] iPhone getting black screen on app launch

查看:79
本文介绍了iPhone在应用启动时出现黑屏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

每当我的应用启动时,我都会黑屏.没有错误消息,我已经在.plist文件中设置了我的主要nib文件.这是我的一些代码.

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;
}

先谢谢了.我是iPhone开发的新手.

Thanks in advance. I am new to iPhone development.

推荐答案

由于更改了MainWindow的rootViewController,因此必须确保将MainWindow.xib的视图出口设置为新的视图控制器.

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

这篇关于iPhone在应用启动时出现黑屏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆