currentThread
現在実行しているスレッドオブジェクトを返します
解説
現在実行しているスレッドオブジェクトを返します。
返り値
( NSThread * )
スレッド
引数
フレームワーク
Foundation
クラス
NSThread
Class Methods
使用可能
10.0
参照
+ detachNewThreadSelector:toTarget:withObject:
例文
#import "MyObject.h" @implementation MyObject - (IBAction)myAction:(id)sender { [NSThread detachNewThreadSelector:@selector(threadTask) toTarget:self withObject:nil]; NSLog([[[NSThread currentThread] threadDictionary] description]); } - (void)threadTask { int i; NSAutoreleasePool *pool = [NSAutoreleasePool new]; for (i=1;i<100;i++) { NSLog([NSString stringWithFormat:@"%d",i]); } [pool release]; [NSThread exit]; } @end