我正在尝试按下面给出的通知推送viewController:
-(void)pushController:(NSNotification *)notifcation{
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
NSString * storyboardName = @"MainStoryboard";
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:storyboardName bundle: nil];
UIViewController * vc = [storyboard instantiateViewControllerWithIdentifier:@"abc"];
[[self navigationController] pushViewController:vc animated:NO];
});}
我检查了其他解决方案并仔细检查了我的[self navigationController]不是nil也不是我的" vc" nil.I还检查了推送代码是否在主线程上运行。我也尝试在我的navigationController中显示viewControllers,我看到了我的" vc"正在推送导航控制器堆栈,但它没有显示在屏幕上。任何人都可以指导我可能出错的地方。