views:

364

answers:

1

How do I execute a method in my ViewController every x milliseconds?

+6  A: 

Create a timer that takes your view and function as arguments to be called. Alternatively you can use NSInvocation with NSTimer.

E.g.

[NSTimer scheduledTimerWithTimeInterval:0.1f target:myView selector:@selector(myMethod) userInfo:nil repeats:YES];
Andrew Grant