1
當我收到推送通知時,我希望導航控制器回到第一個視圖。標籤欄被識別,但是,導航控制器不會回退。將UINavigationController移到UITabBarController中以便第一次查看
- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo {
if (application.applicationState == UIApplicationStateInactive){
UITabBarController *tabb = (UITabBarController *)self.window.rootViewController;
tabb.selectedIndex = 0;
UINavigationController *nav = (UINavigationController *)tabb.navigationController;
[nav popToRootViewControllerAnimated:YES];
}
}
感謝的人!工作正常! – Vins