iphone - moving from one view to another

Posted by codemonkey on Stack Overflow See other posts from Stack Overflow or by codemonkey
Published on 2010-12-30T20:22:30Z Indexed on 2010/12/31 3:55 UTC
Read the original article Hit count: 290

Filed under:
|

Hi there,

I am getting started with iphone development and am trying to move from one view to another.

I have a main view (NearestPhotosViewController) which basically acts as a menu for my app. I then have a second view (DisplayNearestPhotos).

I come from a web (html) background so what i'm trying to do here in web terms is click a button (link) on the NearestPhotosViewController view to then display the DisplayNearestPhotos view.

I have been looking around for some code to do this (I don't think it's as simple as doing the equivelent in html).

The following code is hooked up to a button on my menu view.

  -(IBAction)ButtonPressed:(id)sender
  { 
  DisplayNearestPhotos *views = [[DisplayNearestPhotos alloc] 
         initWithNibName:nil bundle:nil];
  [self presentModalViewController:views animated:YES];
  views.release;
  }

The above code works (it displays the second view) but what i'd like to know is, is that the correct way to do it? If not, what is the correct way to move from one view to another?

Thank you in advance

© Stack Overflow or respective owner

Related posts about iphone

Related posts about uiviewcontroller