我有基于导航的应用程序与第一个RootViewController。iPhone - 插入密码检查
我想用锁屏等密码来保护它。 我已经有密码检查的代码。
但我不知道该怎么
1)RootViewController的前插入我CheckPasswordView第一。
2)每次我的应用程序从暂停中重新打开时,都需要输入密码。
更新:
- (void)applicationDidBecomeActive:(UIApplication *)application {
/*
Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
*/
CheckPasswordViewController *vc = [[CheckPasswordViewController alloc]
initWithNibName:@"CheckPasswordViewController" bundle:nil];
vc.title = @"Enter password";
[self.navigationController pushViewController:vc animated:YES];
[vc release];
}
谢谢!有用。我在applicationDidBecomeActive消息中显示我的PasswordCheckView。正确输入密码后,我将传递给主程序。但是,如果我在没有输入代码的情况下多次重新打开我的应用程序,我发现我要提供多次输入密码。 – Metaller 2012-02-17 15:32:05
我在主要问题中添加了代码。 – Metaller 2012-02-17 15:35:41
@Metaller:很高兴它的工作! – 2012-02-17 15:36:58