iOS定時器,指定時間後觸發。


NSTimer *timer = [NSTimer scheduledTimerWithTimeInterval:30.0f target:self selector:@selector(method) userInfo:nil repeats:NO];
NSDate *date = [NSDate date];
NSLog(@"date:%@",date);
NSDate *fireDate = [NSDate dateWithTimeInterval:10.0f sinceDate:date];
[timer setFireDate:fireDate];

另外:

mark此文

http://blog.csdn.net/chadeltu/article/details/44976527



本人自建的一個iOS交流羣165332140,歡迎各位大神進羣交流指導。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章