我搜索了互联网和堆栈溢出,仍然无法解决这个问题。从appDelegate pushViewController - 问题
这是一个选项卡式应用程序模板。
当应用程序没有运行,并且它收到一个推送通知我想从
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
我通过解析JSON数据等做阅读launchOptions的内容...
那么我想在故事板上的单独视图上显示。
我读过一些帖子的事:
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"MainStoryboard" bundle:nil]; DetailViewController *ivc = [storyboard instantiateViewControllerWithIdentifier:@"Detail"]; [(UINavigationController*)self.window.rootViewController pushViewController:ivc animated:NO];
但是这是给我
*终止应用程序由于未捕获的异常 'NSInvalidArgumentException',原因:' - [的UITabBarController pushViewController:动画:]:无法识别的选择发送到实例0x1c5a0c20'
当应用程序在后台运行,并从
- (void)application:(UIApplication*)application didReceiveRemoteNotification:(NSDictionary*)notification
接收推我叫[[NSNotificationCenter defaultCenter] postNotificationName:@"receivedPushNotification" object:self];
告诉任何视图当前正在显示
detail = [self.storyboard instantiateViewControllerWithIdentifier:@"Detail"]; [self.navigationController pushViewController:detail animated:YES];
工作正常。
的问题是,当应用程序第一次启动,所以我需要把细节视图控制器上的用户的方式,从的appDelegate画面无的这些观点被加载。
由于