我有這個ViewController與它的UIButton。這個按鈕觸發一個方法,這應該在他的位置提供一個modalVC。但由於某種原因,它不再工作了。我以前一直使用相同的代碼,沒有任何問題,但它卻讓我感到困惑。ModalViewController不出現在按鈕上按
-(void)showModalVC //the method that's being fired by the button.
{
NSLog(@"modalVC to create a table"); //this log is being printed so the button fires as proper.
self.myModalVC = [[MyModalViewController alloc] init]; //a local var gives same results.
self.myModalVC.dismissDelegate = self; //the delegate is handled as proper.
UINavigationController *navController = [[UINavigationController alloc]
initWithRootViewController:self.myModalVC];
//navController.modalPresentationStyle = UIModalPresentationFormSheet;
[self presentModalViewController:navController animated:YES];
[self.myModalVC release];
[navController release];
}
什麼可能是一個ModalVC不彈出我的當前視圖從哪裏它被稱爲的原因?
我一直在使用這個非常相同的方法(在其他上下文中的其他項目),所以我很眩目它還沒有工作。該方法被解僱,它傳遞的每一行代碼都沒有崩潰。
如果你有一個想法。張貼在這裏。 謝謝。
感謝您的意見。然而,這不是一個記憶問題。我在函數結尾處釋放的alloc以及我的類的dealloc方法中的屬性。由於我沒有雙重免費崩潰或泄漏彈出,我認爲我很安全。 –