iOS SDK IBOutlet (View-based)

索引サイト




#import

@interface iPhoneViewController : UIViewController {
IBOutlet UIButton *button1;
IBOutlet UIButton *button2;
IBOutlet UIButton *button3;
IBOutlet UIButton *button4;
IBOutlet UIButton *button5;

IBOutlet UITextField *text1;
IBOutlet UITextField *text2;
IBOutlet UITextField *text3;
IBOutlet UITextField *text4;
IBOutlet UITextField *text5;
}

@property (nonatomic,retain) UIButton *button1;
@property (nonatomic,retain) UIButton *button2;
@property (nonatomic,retain) UIButton *button3;
@property (nonatomic,retain) UIButton *button4;
@property (nonatomic,retain) UIButton *button5;

@property (nonatomic,retain) UITextField *text1;
@property (nonatomic,retain) UITextField *text2;
@property (nonatomic,retain) UITextField *text3;
@property (nonatomic,retain) UITextField *text4;
@property (nonatomic,retain) UITextField *text5;

- (IBAction)push1:(id)sender;
- (IBAction)push2:(id)sender;
- (IBAction)push3:(id)sender;
- (IBAction)push4:(id)sender;
- (IBAction)push5:(id)sender;

@end





#import "iPhoneViewController.h"

@implementation iPhoneViewController

@synthesize button1;
@synthesize button2;
@synthesize button3;
@synthesize button4;
@synthesize button5;

@synthesize text1;
@synthesize text2;
@synthesize text3;
@synthesize text4;
@synthesize text5;

- (IBAction)push1:(id) sender{
text1.text = @"button1 pushed";
}
- (IBAction)push2:(id) sender{
text2.text = @"button2 pushed";
}
- (IBAction)push3:(id) sender{
text3.text = @"button3 pushed";
}
- (IBAction)push4:(id) sender{
text4.text = @"button4 pushed";
}
- (IBAction)push5:(id) sender{
text5.text = @"button5 pushed";
}




- (void)dealloc {
[button1 release];
[button2 release];
[button3 release];
[button4 release];
[button5 release];
[text1 release];
[text2 release];
[text3 release];
[text4 release];
[text5 release];
[super dealloc];
}





AX