in code snippets, it does not show when and where NSTimer
starts.
if you want to use NSTimer
, you must start the timer after init, for example:
NSTimer *_timer = [NSTimer scheduledTimerWithTimeInterval:2.f target:self selector:@selector(hideManual) userInfo:nil repeats:false]; [_timer fire];
but you can also use the following line in your any method:
[self performSelector:@selector(hideManual) withObject:nil afterDelay:2.f];
in this case, it looks easier than working with NSTimer
.
holex source share