简体   繁体   中英

How do I subscribe to the end of the event loop

I have developed an ORM for iOS and I would like to automatically call the 'persist' command which saves all dirty objects when the event loop ends and control is returned, instead of requiring the developer to explicit call the method.

I don't know exactly what this would even be called and consequently am having difficulty even formulating a search for the question. But, as I understand now, for example, the autorelease pools are drained during this time. Basically, I'd like to add the call just before the autorelease pools get drained.

您可以使用-AppDelegate的-applicationWillResignActive:方法

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM