Reputation: 1
timer =[NSTimer scheduledTimerWithTimeInterval:5.0
target:self
selector:@selector(onTimer)
userInfo:nil
repeats:YES];
Can I change the scheduledTimerWithTimeInterval to a specific time in the day? Without changing a lot of the code I already have?
Upvotes: 0
Views: 262
Reputation: 135540
The documentation is your friend:
timer = [[[NSTimer alloc] initWithFireDate:myDate interval:5.0 target:self selector:@selector(onTimer) userInfo:nil repeats:YES] autorelease];
[[NSRunLoop currentRunLoop] addTimer:timer forMode:NSDefaultRunLoopMode];
Upvotes: 3