我有基於導航的應用程序與第一個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