tags:

views:

316

answers:

1

Hi,

I need to run a particular method every app loop. How can I add it to the loop?

I didn't find any signs of this loop in the app delegate file and anywhere else?

How can I do this?

Thanks.

+5  A: 

This doesn't seem practical. The iPhone's application run loop will be executed anytime that there is an event that the application needs to process.

Perhaps you would be better off installing a timer (NSTimer) that runs periodically?

Lyndsey Ferguson
Yes -- and if you set the period for the timer small enough, it will run on practically every iteration of the loop. Many light realtime OpenGL animations can be done using NSTimer in this way. Ultimately, if you need maximum performance (for an OpenGL game or similar), you'll want to write your own loop -- but I don't recommend this until as a first option.
Matt Gallagher