-4

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

death7eater
  • 1,094
  • 2
  • 14
  • 35
  • 2
    read about NSTimer which does exactly what you're looking for. https://developer.apple.com/library/mac/#documentation/Cocoa/Reference/Foundation/Classes/nstimer_Class/Reference/NSTimer.html – Simon Aug 23 '12 at 08:22
  • This question is so far away from the OP being able to use NSTimer that they are not helpful suggestions. – Jessedc Mar 04 '14 at 10:28

2 Answers2

3
NSTimer *timer = [NSTimer scheduledTimerWithTimeInterval:10 target:self selector:@selector(yourMethod) userInfo:nil repeats:YES];
janusfidel
  • 8,036
  • 4
  • 30
  • 53
0

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

user1587432
  • 39
  • 1
  • 6