Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 01-23-2011, 11:26 AM   #1 (permalink)
Registered Member
 
Join Date: Jan 2011
Location: Chicago
Posts: 19
Yoyoma31314 is on a distinguished road
Default Button to a new view

I was wondering how you have a button open a new View or Window, preferably have the view be scrollable.
Yoyoma31314 is offline   Reply With Quote
Old 01-23-2011, 12:01 PM   #2 (permalink)
Registered Member
 
railion's Avatar
 
Join Date: Jan 2011
Posts: 118
railion is on a distinguished road
Default

Quote:
Originally Posted by Yoyoma31314 View Post
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.
railion is offline   Reply With Quote
Old 09-13-2011, 03:21 AM   #3 (permalink)
Registered Member
 
Join Date: Feb 2011
Posts: 12
Boudicca is on a distinguished road
Default small addition

don't forget to import the new views '.h' into the first view
Boudicca is offline   Reply With Quote
Reply

Bookmarks

Tags
button, view

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 360
10 members and 350 guests
7twenty7, dre, iAppDeveloper, jeroenkeij, Mah6447, Morrisone, sacha1996, Sami Gh, stanny, toon4413
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,667
Threads: 94,120
Posts: 402,898
Top Poster: BrianSlick (7,990)
Welcome to our newest member, host number one
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 03:42 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0