detachDrawingThread:toTarget:withObject:
新しいオートリリースプールを作って、スレッドを実行します
+(void)detachDrawingThread:(SEL)selector: toTarget:(id)target: withObject:(id)argument:
解説
新しいオートリリースプールを作って、スレッドを実行します。
返り値
( void )
なし
フレームワーク
ApplicationKit
クラス
NSApplication
Class Methods
使用可能
10.0
参照
例文
#import "Controller.h" @implementation Controller - (IBAction)pushButton:(id)sender { //サブスレッドを作って実行する [NSApplication detachDrawingThread:@selector(action:) toTarget:self withObject:@" sub thread"]; //メインの方の処理 int i; for (i=1;i<2000;i++) { NSLog(@"main thread %d",i); } } -(void)action:(id)arg { //サブの方の処理 int i; for (i=1;i<2000;i++) { NSLog(@"%@ %d",arg,i); } } @end