Best way to do something when a runloop event is done processing?

Posted by quixoto on Stack Overflow See other posts from Stack Overflow or by quixoto
Published on 2010-06-12T22:29:20Z Indexed on 2010/06/12 22:32 UTC
Read the original article Hit count: 259

Filed under:
|

I have some processing in my Cocoa app that sometimes ends up calling through a hierarchy of data to do a bunch of work as the result of an event. Each small piece creates and destroys some resources. I don't want those resources around most of the time, but I would like to find a smart way of creating them before all the work and killing them at the end.

Short of creating the resources up front and then passing them entirely down through the call hierarchy when work is done, is there a way to know locally in some code when an event loop run has ended? Then I could create them if they're not there, and keep them until the run loop ends, reusing them for any subsequent calls before that time.

Thanks.

© Stack Overflow or respective owner

Related posts about cocoa

Related posts about nsrunloop