I am designing an iphone application and I need help structuring the program. I am new to xcode, but I’m still using xcode 3 because I don’t have lion. The question I have pertains to using a view controller. My first question is how do I get rid of the view on the screen if I do not know which view is on the screen? My next question is how do I add the view I want to? I know i’m asking alot but I’ve tried a bunch of stuff and its not working.
Share
You can get the list of subviews currently displayed on the view like this:
or if you assign each one a tag when you add it, you can get a particular subview by its tag, ie.
Once you’ve created an object for the view you want to work with you can simply call removeFromSuperview:
Is that what you mean? Like removing buttons and images from the screen? Or do you actually mean you want to push/pop view controllers (like returning to the main menu from a game, etc)