-1
我有一個自制的「註銷控制器」爲我的應用程序,我將不勝感激您對問題的幫助。註銷控制器崩潰,而不是允許用戶註銷
我的「註銷控制器」包含我的應用程序,通過從另一個控制器的簡單側滑動訪問;不過,我已將「註銷」按鈕置於簡單的UITableViewController
中。
當我點擊「註銷」按鈕時,應用程序崩潰,我不確定如何解析數據,以便用戶在按下按鈕後成功註銷。如果有人能告訴我我哪裏出錯了,那將是救命!
- (IBAction)logOutAction:(id)sender {
NSLog(@"yes");
PDKeychainBindings *bindings = [PDKeychainBindings sharedKeychainBindings];
[bindings setObject:@"no" forKey:@"loggedIn"];
[bindings setObject:@"" forKey:@"userID"];
UIWindow *window = [[UIApplication sharedApplication] keyWindow];
UINavigationController *nav = (UINavigationController*)window.rootViewController;
UIViewController *login = [nav.viewControllers objectAtIndex:0];
UINavigationController *slider = (UINavigationController*)login.presentedViewController;
self.logOutButton.enabled = NO;
[self.logOutButton setAlpha:0.8];
[self performSelector:@selector(logOutAction:) withObject:nil afterDelay:0.1];
[self setModalTransitionStyle:UIModalTransitionStyleCrossDissolve];
[login dismissViewControllerAnimated:YES completion:^{
}];
}
- (IBAction)close:(id)sender {
//UIWindow *window = [[UIApplication sharedApplication] keyWindow];
//DYNavigationController *nav = (DYNavigationController*)window.rootViewController;
//UIViewController *login = [nav.viewControllerStack objectAtIndex:0];
// CustomNavController *slider = (CustomNavController*)login.presentedViewController;
//[self setModalTransitionStyle:UIModalTransitionStyleCrossDissolve];
//[login dismissViewControllerAnimated:YES completion:^{
// }];
[self dismissViewControllerAnimated:YES completion:nil];
}
您需要提供例外的詳細信息!顯示異常名稱,描述和堆棧跟蹤。 – Wain
爲什麼你正在執行IBOutlet上的選擇器 – Retro
哪裏崩潰,什麼是 –