| Home 目次>ApplicationKit>NSApplication このサイトはこちらに移転しました。 | |
tryToPerform:with:
アクションメッセージを送ってみます
-(BOOL) tryToPerform:(SEL)aSelector
with:(id)anObject
【返り値】 | |
| BOOL | YES/NO |
| 【パラメータ】 | |
| aSelector | セレクタ |
| anObject | オブジェクト |
【解説】
アクションメッセージを送ってみます。
【例文】
#import "Controller.h"
@implementation Controller
- ( IBAction )pushButton:( id )sender
{
[NSApp setDelegate: self ];
[NSApp tryToPerform: @selector (theAction:)
with: @"sss"
];
}
-( void )theAction:( id )message
{
NSLog([message description]);
}
@end
![]() | |
この記事を評価してください。
| Home 目次>ApplicationKit>NSApplication | 修正日2007.12.26 |