propertyを設定する
ヘッダーファイル
OutLetとして使う変数をproperty設定する。
@interface ....{ UIButton myButton; } @property (nonatomic, retain) IBOutlet UIButton *myButton;
メインファイル
ヘッダーで設定したpropertyのGetter,Setterの生成
@synthesize myButton; - (void)dealloc { [myButton release]; [super dealloc]; }
- [myButton release];:変数のメモリ解放コードも実装