start!!ここでは、例によってNSRunLoopを実行させているので、ひと通りの動作が終わったところで手動で終了させてください。――では、ここで行っている処理を整理していきましょう。
timer message:1
timer message:2
timer message:3
end.
※リストが表示されない場合
AddBlockなどの広告ブロックツールがONになっているとリストなどが表示されない場合があります。これらのツールをOFFにしてみてください。
#import <Foundation/Foundation.h>
#import "MyTestClass.h"
int main (int argc, const char * argv[]) {
@autoreleasepool {
MyTestClass* obj = [MyTestClass
myTestClassToEndCount:3];
NSDictionary* data = [NSDictionary
dictionaryWithObject:@"timer message"
forKey:@"msg"];
NSTimer* timer = [NSTimer
scheduledTimerWithTimeInterval:1.0
target:obj selector:@selector(printMessage:)
userInfo:data repeats:YES];
NSLog(@"start!!");
// 終了しないようにしておく
[[NSRunLoop currentRunLoop] run];
}
return 0;
}
| << 前へ | 次へ >> |