2013-02-08 65 views
0

我將loadView添加到我的LoginController中,現在我的應用程序在啓動圖像後變黑屏。 最好的解決方法是什麼? Theres任何方式運行autoLogin發射圖像?loadView和黑屏

AppDelegate.h

// Load Login View 
UIViewController *loadView = [[[LoginViewController alloc] init] autorelease]; 
self.window.rootViewController = loadView; 
[self.window makeKeyAndVisible]; 

LoginController.h:

- (void)loadView { 
    [self autoLogin]; 
    [super loadView]; 
} 

回答

0

的loadView僅用於編程建立起自己的看法觀點時引用的第一次。你可能就要什麼是viewDidLoad中

1

您需要創建自己的UIView並將其設置爲self.view

- (void)loadView 
{ 
    self.view = [UIView alloc] initWithRect:CGRectMake(0, 0, 200, 300)]; 
    self.view.backgroundColor = [UIColor redColor]; 
}