iphone - moving from one view to another
- by codemonkey
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