| Home 目次>ApplicationKit>NSActionCell | |
setAction:
アクションセルにアクションセレクタをセットします
-(void) setAction:(SEL)aSelector
【返り値】 | |
| void | なし |
| 【パラメータ】 | |
| aSelector | セットするセレクタ |
【解説】
アクションセルにアクションセレクタ(aSelector)をセットします。
【例文】
#import "MyObject.h"
@implementation MyObject
- ( IBAction )action1:( id )sender
{
if ([sender action] == @selector (action1:)){
NSLog( @"action1" );
[sender setAction: @selector (action2:)];
}
}
- ( IBAction )action2:( id )sender
{
if ([sender action] == @selector (action2:)){
NSLog( @"action2" );
[sender setAction: @selector (action3:)];
}
}
- ( IBAction )action3:( id )sender
{
if ([sender action] == @selector (action3:)){
NSLog( @"action3" );
[sender setAction: @selector (action1:)];
}
}
@end
![]() | |
この記事を評価してください。
| Home 目次>ApplicationKit>NSActionCell | 修正日2008.1.17 |