سؤال

Let us say I have a void function which just have NSLog(@"Call me"); in its body.

How can I call it in my view like in every ten seconds. I know it sounds like very beginner question but I really need it

هل كانت مفيدة؟

المحلول

NSTimer *timer = [NSTimer scheduledTimerWithTimeInterval:10 target:self selector:@selector(yourMethod) userInfo:nil repeats:YES];

نصائح أخرى

Use NSTimer class [NSTimer scheduledTimerWithTimeInterval:10.0 target:self selector:@selector(makeMyProgressBarMoving) userInfo:nil repeats:YES]

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