我只是想知道是否可以在我解雇一个 ViewController 后立即推送到一个 ViewController。
我一直在尝试这个:
-(void)dismiss{
//send information to database here
[self dismissViewControllerAnimated:YES completion:^{
NSLog(@"Dismiss completed");
[self pushtoSingle:post_id];
}];
}
-(void)pushtoSingle:(int)post_id{
Single1ViewController *svc = [self.storyboard instantiateViewControllerWithIdentifier:@"SingleView"];
svc.post_id = post_id;
svc.page = 998;
[self.navigationController pushViewController:svc animated:YES];
}
和这个:
-(void)dismiss{
//send information to database here
[self dismissViewControllerAnimated:YES completion:^{
NSLog(@"Dismiss completed");
Single1ViewController *svc = [self.storyboard instantiateViewControllerWithIdentifier:@"SingleView"];
svc.post_id = post_id;
svc.page = 998;
[self.navigationController pushViewController:svc animated:YES];
}];
}
但没有成功。视图已成功关闭,但推送从未初始化。是否有另一种已知的解决问题的方法?