iOS7.0 NSTimer使用

今天看视频教程,基于IOS5的,里边在初始化NSTimer用的是

[NSTimer timerWithTimeInterval:1.0 target:self selector:@selector(update) userInfo:nil repeats:YES];


使用后每次update方法只执行了一次,不过视频里是用的这个方法处罚的,之后改用

[NSTimer scheduledTimerWithTimeInterval:1.0 target:self selector:@selector(update) userInfo:nil repeats:YES];

能够正常使用,不明觉厉,以后切记使用后者避免出错。

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