Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to correctly switch view?
    text
    copied!<p>i know its already allot of info about that in internet, but i'm new to programming and little confused, i need little help please... for example i have 10 views controllers and switching between it with a buttons for example i switching with</p> <pre><code> -(IBAction)goToSecondView:(id)sender { SecondViewController *secondView = [[SecondViewController alloc] initWithNibName:@"SecondViewController" bundle:nil]; [self presentModalViewController:secondView animated:NO]; [secondView release]; } /* or */ -(IBAction)goToSecondView:(id)sender { SecondViewController *secondView = [[SecondViewController alloc] initWithNibName:@"SecondViewController" bundle:nil]; [self.view addSubview:secondView.view]; [secondView release]; } </code></pre> <p>and after need if i switch to remove the first view with that:</p> <pre><code>[self.view removeFromSuperview]; /* or */ [self dismissModalViewControllerAnimated:YES]; </code></pre> <p>and i dont know how to make remove the first view when i switching to second, for example when go from <strong>FirstView</strong> to <strong>SecondView</strong> the second view, need to remove the <strong><em>FirstView</em></strong> and after from <strong>SecondView</strong> go to <strong>ThridView</strong> or to <strong>SevenView</strong> example and need to remove the <strong><em>SecondView</em></strong>... how can i do that?can you make a sample code please? i know its very easy but not for me, im new to programming</p> <p>--------------------update-----------------------------------------------------------------</p> <p>i want make something like > <a href="http://www.iphonedevsdk.com/forum/iphone-sdk-development/52107-how-correctly-switch-controller.html" rel="nofollow noreferrer">here</a> &lt; but i dont understand all, can any one make a sample code please?.</p> <p><strong>Thank You Very Much</strong></p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload