What is the difference between a timer and a scheduled timer in objective c?

StackOverflow https://stackoverflow.com/questions/22138525

  •  19-10-2022
  •  | 
  •  

سؤال

So I was making a timer, and I came across two different statements that I didn't know the difference between. Here is my code:

Mover = [NSTimer scheduledTimerWithTimeInterval:0.1 target:self selector:@selector(MoveDown) userInfo:nil repeats:YES];

What is the difference between that and:

Mover = [NSTimer timerWithTimeInterval:0.1 target:self selector:@selector(MoveDown) userInfo:nil repeats:YES];

لا يوجد حل صحيح

نصائح أخرى

Scheduled timers are automatically added to the run loop, unscheduled timers are not. The timer functionality is the same.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top