Quantcast
Channel: Recent Threads — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 204402

ViewDidAppear firing in IOS Simulator but not on Device

$
0
0

Hi I have created a Home screen that has a button on that displays a Game screen when it is pushed. My AppDelegate declares a Navigation controler and wires up the HomeScreen to the NavigationController using the code below.

var rootNavigationController = new UINavigationController ();

HomeScreen homeScreen = new HomeScreen ();

rootNavigationController.PushViewController (homeScreen, false);

this.window.RootViewController = rootNavigationController;

In the Home screen , I have code like this to display the Game Screen.

if(this.gameScreen == null) { this.gameScreen = new GameScreen(); } this.NavigationController.PushViewController (this.gameScreen , true);

I have some initialisation code in the Game Screen and I do it in the ViewDidAppear override function. So, anytime I am moving from the Home Screen to the Game screen I would expect the ViewDidAppear function to be called. This seems to work fine in the simulator (I can debug and see the code jump into the ViewDidAppear function every time I move from the Home to Game Screen). BUT, on the actual IOS device, this ViewDidAppear code is not called when I go back into the Game screen.

Just wondering if I have missed something here that is not allowing the ViewDidAppear code to fire on the actual device? Also, why is this behaviour different on the device compared to the Simulator?

Thanks for any help


Viewing all articles
Browse latest Browse all 204402

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>