此刻我的錯誤表明我的視圖控制器已經呈現爲null。我想我有我的下面的代碼正確的想法,但我沒有正確實施它。感謝您的幫助呈現第二個模式視圖控制器的問題
-(IBAction)datePicker
{
//UIViewController *presenter = self.presentingViewController;
[self dismissViewControllerAnimated:YES completion:^{
/*
UIStoryboard* sb = [UIStoryboard storyboardWithName:@"MainStoryboard.storyboard"
bundle:nil];
UIViewController* dateView = [sb instantiateViewControllerWithIdentifier:@"DatePickerViewController"];
*/
[self performSegueWithIdentifier:@"dueDateSegue" sender:self];
//[presenter presentViewController:dateView animated:YES completion:nil];
/*
[self presentViewController:dateView animated:YES completion:^{
UIBarButtonItem *saveDate = [[UIBarButtonItem alloc]
initWithTitle:@"Save Date"
style:UIBarButtonItemStyleDone
target:self
action:@selector(labelDatePicker)];
self.navigationItem.rightBarButtonItem = saveDate;
pick = [[UIDatePicker alloc] init];
[pick setFrame:CGRectMake(0,200,320,120)];
//[pick addTarget:self action:@selector(done) forControlEvents:UIControlEventValueChanged];
//dateFieldText.delegate = self;
//dateFieldText.inputView = pick;
}];
*/
}];
}
你是否解僱了av當一個人沒有真正出現時控制控制器?如果沒有什麼可以解僱的話,這個街區是否會運行? dismissViewControllerAnimated:completion的文檔表明,除非事實上被解散,否則塊將不會運行。 – GoZoner 2013-03-16 19:24:18