我仍然是新手IOS开发,我想通过MoralViewcontroller创建一个登录页面。标签控制器视图之前IOS登录屏幕
AppDelegate.h
@interface AppDelegate : UIResponder <UIApplicationDelegate>{
UITabBarController *tabBarController; }
@property (nonatomic,retain) IBOutlet UITabBarController * tabBarController
AppDelegate.m
(void)applicationDidFinishLaunching:(UIApplication *)application
{
// Override point for customization after app launch
[window addSubview:tabBarController. view];
[window makeKeyAndVisible];
LoginViewController *loginView=[[LoginViewController alloc]initWithNibName:@"LoginViewController" bundle:nil];
[tabBarController.view presentModelViewcontroller: loginView animated:YES];
}
然而,无法显示的登录观点,我觉得我定义为错误tabBarController,但我不知道它有什么问题。任何人都可以请教我吗?我做的IOS 5
非常感谢..
嗨斯里,感谢您的回复,您能解释更多细节吗?非常感谢:) – 2012-02-07 10:12:06
这意味着在didFinishLaunchingWithOptions方法中添加loginviewcontroller到Window.And在应用程序委托写一个像这样的方法 - (void)showTabBar { \t [self.window addSubview:tabBarController.view]; \t [loginviewController.view removeFromSuperview]; }。当你点击loginviewcontroller – Tendulkar 2012-02-07 10:57:52
中的提交或登录按钮时,致电上述方法很抱歉打扰你。启动页面是TabBarController并为登录页面提供道德视图? – 2012-02-07 12:17:56