我将loadView添加到我的LoginController中,现在我的应用程序在启动图像后出现黑屏。解决这个问题的最好方法是什么?有没有办法在启动镜像中运行autoLogin?
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];
}发布于 2013-02-09 01:06:46
loadView仅用于在第一次引用视图时以编程方式构建视图。您可能想要的是viewDidLoad
发布于 2013-02-09 01:11:41
您需要创建自己的UIView并将其设置为self.view
- (void)loadView
{
self.view = [UIView alloc] initWithRect:CGRectMake(0, 0, 200, 300)];
self.view.backgroundColor = [UIColor redColor];
}https://stackoverflow.com/questions/14777646
复制相似问题