[IOS]NSTimer启动与停止 (2012-02-03 14:49:06)转载▼
标签: 杂谈 分类: Code
timer = [NSTimer scheduledTimerWithTimeInterval:3.0 target:self selector:@selector(function:) userInfo:nil repeats:NO];
timer运行一次就会自动停下
timer = [NSTimer scheduledTimerWithTimeInterval:3.0 target:self selector:@selector(function:) userInfo:nil repeats:YES];
就会每三秒运行一次function
在function:中加入 [timer invalidate];语句可在内部令其停止
[IOS]NSTimer启动与停止 (2012-02-03 14:49:06)转载
猜你喜欢
转载自longquan.iteye.com/blog/1700941
今日推荐
周排行