首页 新闻 会员 周边

关于RunLoop(timer)

0
悬赏园豆:5 [已关闭问题] 关闭于 2016-04-02 09:14
- (void)viewDidLoad {
    [super viewDidLoad];
    NSTimer *timer = [NSTimer scheduledTimerWithTimeInterval:2.0 target:self selector:@selector(run) userInfo:nil repeats:YES];

    [[NSRunLoop currentRunLoop] addTimer:timer forMode:UITrackingRunLoopMode];
}

- (void)run {
    NSLog(@"-----run");
}

理论上应该在滚动视图执行定时器,但并没有实现效果,求指教!

blue-fly的主页 blue-fly | 菜鸟二级 | 园豆:202
提问于:2016-03-31 09:38
< >
分享
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册