今天看視頻教程,基於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];
能夠正常使用,不明覺厲,以後切記使用後者避免出錯。