how to restore view to view did load
i am using a view that displays multiple items depending on user input and i would like to when i press a button to be able to go back to the first view generated in the view (viewDidLoad
).
I tried numerius methods such as adding an action to a selector to load a -(void)
that reloads the view however that crashes too.
I havent been able to find a resolution to this problem for qu开发者_运维知识库ite some time
Thanks
You may need to post some code to get a better answer. I'll assume that you are showing views on your original view, and some of them cover your original view. If this is the case, the original view still exists, and you simply need to remove the views that were added later. If they were presented as a modal dialog, remove with [childViewController dismissModalViewControllerAnimated:YES]
. If you added them with [self.view addSubview:childView]
, remove them with [childView removeFromSuperView]
. If you are using a navigation controller, you'll similarly need to pop your child view. Instead of adding and removing views you could hide or show them if they should only be initialized once. If you want a more specific answer, reduce your code to the minimum required to make it happen and post it!
精彩评论