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

Why does PerformSegue create a new instance of a ViewController I've already created via Storyboard

$
0
0

Greetings all,
I'm hoping someone can answer my question.

Firstly, I'm using a ContainerViewController to navigate between two other view controllers. (Say ViewController1 and ViewController2)
In the ViewDidLoad of the ContainerViewController, I create ViewController1 & ViewController2 via the Storyboard.InstantiateControllerWithIdentifier.
I then InsertChildViewController for both.

Upon an event received, I invoke PerformSegue for the controller at ChildViewControllers.ElementAt(1) (for testing)
The constructor of ViewController2 is hit from the Storyboard.InstantiateControllerWithIdentifier, and yet a second hit for when PerformSegue is invoked.

Is this the correct behavior or a potential bug?
any insight will be greatly appreciated.


Viewing all articles
Browse latest Browse all 204402

Trending Articles



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