I have afew doubts about 开发者_如何学JAVAhow I've being using UINavigationController.
My question simply is, is it better practice to completely populate the viewcontrollers stack with all the views it will need and navigate through the view using methods like popToViewController.
-Or-
Is it better to simpy push a view to the stack when you need it? For example If I push a view controller and then hit the back button and then push the same view controller again will there be 2 instances on that view in the stack or does the action of hitting the back button remove it?
Generally, pushing view controllers when you need them is what lazy loading is meaning: use resources when you need them. There is no point in creating whole hierarchy at start because that spells trouble and requires significant management overhead. Why do something by yourself when someone else implemented for you and you know it works?
精彩评论