I have a requirement that runs my code exactly once per run loop, and I'm 
wondering what the modern preferred way to do this is.

I've developed the code using a timer with a very fast rate which I know can't 
really be met, so effectively it's calling back once per loop, but I figure 
there has to be a supported way to do that.

Is using -[NSRunLoop addPort:forMode:] the way to do this, or would using an 
NSOperation on the main queue be better? Since my code loops continuously, 
creating a separate new task each turn of the loop seem inefficient - better if 
there's something I can create once and it is called once per loop until I tell 
it to stop.

I've never had call to do this before, so I'm not sure what I should be doing 
here.

--Graham



_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to