开发者

Pop and push the same view does not invoke the viewWillAppear() method

开发者 https://www.devze.com 2023-03-18 02:09 出处:网络
When I receive a local notification i do the following: - (void)application:(UIApplication *)application didReceiveLocalNotification:(UILocalNotification *)notif {

When I receive a local notification i do the following:

- (void)application:(UIApplication *)application didReceiveLocalNotification:(UILocalNotification *)notif {
    [navController popToRootViewControllerAnimated:NO];
    [navController pushViewControll开发者_StackOverflower:notificationSplashViewController animated:YES];
}

If my notificationSplashViewController is the current ViewController, its viewWillAppear() method is not invoked. How can I detect the re-push of notificationSplashViewController?


Try:

[notificationSplashViewController.view removeFromSuperview];
[navController popToRootViewControllerAnimated:NO];
[navController pushViewController:notificationSplashViewController animated:YES];

for me, this did the trick.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号