| Home 目次>ApplicationKit>NSActionCell | |
action
アクションセルのアクションセレクタを返します
-(SEL) action
【返り値】 | |
| SEL | アクションセレクタ |
【解説】
アクションセルのアクションセレクタ(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 |