Tôi chỉ tự hỏi liệu nó có thể đẩy đến một ViewController ngay sau khi tôi loại bỏ nó không.dismissViewControllerAnimated: completion: Đẩy sang ViewController khác
Tôi đã cố gắng với điều này:
-(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];
}
Và đây:
-(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];
}];
}
Nhưng không thành công. Chế độ xem được loại bỏ thành công nhưng việc đẩy không bao giờ được khởi tạo. Có cách nào khác được biết về vấn đề này không?
câu trả lời tuyệt vời ... chỉ muốn thêm rằng đó là một ý tưởng hay để làm –