Open another view when button is pressed in iOS

Viewed 28417

I am completely new to iOS development and I want to load another view when a button is pressed in a present view.

I have created a view based application and following are the codes:

//My file name is poo1

//This is poo1ViewController.h file

#import <UIKit/UIKit.h>
@interface poo1ViewController : UIViewController 
{
 IBOutlet UIButton *fl;
}
@property (nonatomic,retain) UIButton *fl;
-(IBAction) ifl:(id)sender;    
@end

//This is poo1ViewController.m file

#import "poo1ViewController.h"
@implementation poo1ViewController
@synthesize fl;
-(IBAction) ifl:(id) sender {
}

In the poo1ViewController.xib I have added a button and linked it with File's Owner using Interface Builder.

Now I have added another view to this class called as flip.xib an just added a label inside it.

The thing I want is, when I will press the fl button, the fl button will call the method ifl and which in return should call the second view, i.e. flip.xib.

How will I do that, how can I make the ifl method to load flip.xib view ?

1 Answers
Related