PDA

View Full Version : [iPhone] changing views




rand0m3r
May 17, 2008, 06:58 AM
hi. i want to write a very simple application.

if a button on the first screen is pressed, i want to go to the 2nd screen.

right now, i have a controller for each screen/view. in my delegate i have [window addSubview:controllersView]; for the first view.

so when the button is pressed, the communication should happen as follows:
firstView --> firstViewController --> delegate

the delegate's window should be told to add the 2nd controller's view to the vier hierarchy. but right now, when i press the button - the view does not change.

can anyone provide any help? thanks.



Sayer
May 17, 2008, 01:19 PM
Apple has provided a ton of sample code projects that cover basic topics such as this.

Here is one that does exactly what you asked about:

http://developer.apple.com/iphone/library/samplecode/ViewTransitions/index.html

rand0m3r
May 17, 2008, 10:44 PM
that's a very confusing example. has someone got something more simple.