views:

224

answers:

1

Hi,

I am try to do multi-threading in Objective C. What I want to do now is that, for some instance of objects, I want to have to way to call some function 5 seconds later. How can I do that?

In Coco 2D, it's very easy to do it. They have something called scheduler. In Objective C, how to do it please?

Thanks

+1  A: 

You can use performSelector:withObject:afterDelay:

For example:

[self performSelector:@selector(myFunc:) withObject:nil afterDelay:5.0];
Philippe Leybaert