Quote:
Originally Posted by Yoyoma31314
I was wondering how you have a button open a new View or Window, preferably have the view be scrollable.
|
Hello Yoyoma.
First you have to add a new view and a button in Interface Builder.
Next thing is to declare the view in your .h file:
Code:
IBOutlet UIView *view1;
IBOutlet UIButton *button1;
And then add a property and an IBAction:
Code:
-(IBAction)showView1:(id)sender;
@property (nonatomic, retain) IBOutlet UIView *view1;
@property (nonatomic, retain) IBOutlet UIButton *button1;
Then in your .m file synthesize the objects:
Code:
@synthesize view1, button1;
And then add the action to the .m file:
Code:
-(IBAction)showView1:(id)sender{
[self addSubView:view1];
}
Then in Interface Builder just link the objects together, and there you go.