当收到推送通知时,我需要知道如何打开另一个视图控制器而不是主视图控制器,请帮助我提前感谢这是我的代码“
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
sleep(2);
[[UIApplication sharedApplication] registerForRemoteNotificationTypes:
(UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeAlert | UIRemoteNotificationTypeSound)];
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
// Override point for customization after application launch.
NSUserDefaults* ud = [NSUserDefaults standardUserDefaults];
consumerId = [[ud objectForKey:@"consumerId"] intValue];
couponSql = [[CouponsSqlClass alloc] init];
if (consumerId == 0) {
self.viewController = [[LandingPageViewController alloc] initWithNibName:@"LandingPageViewController" bundle:nil];
self.window.rootViewController = self.viewController;
}
else {
application.applicationIconBadgeNumber = 0;
EditProfileViewController* mainViewController = [[EditProfileViewController alloc] initWithNibName:@"EditProfileViewController" bundle:nil];
_mainViewNavController = [[UINavigationController alloc] initWithRootViewController:mainViewController];
KluebookMenuViewController* leftSideMenuViewController = [[KluebookMenuViewController alloc] initWithNibName:@"KluebookMenuViewController" bundle:nil];
self.deskController = [[IIViewDeckController alloc] initWithCenterViewController:self.mainViewNavController leftViewController:leftSideMenuViewController];
self.deskController.leftLedge = 60;
self.window.rootViewController = self.deskController;
}
[self.window makeKeyAndVisible];
return YES;
}