我试图打开子视图(PostReaderViewController,图像上的第四个视图)当应用程序通过推送通知午餐时它是。故事板图片: 这是我的代码:Performe,导航,从应用程序委托子视图
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
...
//Detecting if the app was lunched by clicking on push notification :
NSDictionary *userInfo = [launchOptions valueForKey:@"UIApplicationLaunchOptionsRemoteNotificationKey"];
NSDictionary *apsInfo = [userInfo objectForKey:@"aps"];
if(apsInfo) {
UIStoryboard *mainstoryboard = [UIStoryboard storyboardWithName:@"Main" bundle:nil];
PostReaderViewController* postReader = (PostReaderViewController *)[mainstoryboard instantiateViewControllerWithIdentifier:@"postReaderView"];
CostumSDPost *tempPost = [[CostumSDPost alloc] init];
tempPost.ID = userInfo[@"post_id"];
postReader.thePost = tempPost;
[self.window.rootViewController presentViewController:postReader animated:YES completion:NULL];
//userInfo[@"post_id"]);
}
return YES;
}
当我通过推送通知启动我的APP没有错误显示,但它unfortunly启动并显示默认的视图(图像第三视图)。
请注意,我使用SWRevealMenu和INTIAL点(图像查看首)是显示视图控制器