Application Lifecycle & autorelease pools

来源:转载

Application Lifecycle

After application:didFinishLaunchingWithOptions:, then what?

Application enters a “run loop” repeatedly doing the following ...

An autorelease pool is created (more on this in a moment)Application waits for events (touch, timed event, I/O, etc.)
Events are dispatched through UIKit objects and often on to your objects (via delegates, etc.)
When all is done, the screen is updated (appropriate drawRect: methods are called)
The autorelease pool is drained


Rinse, repeat. 

 

 

注:两次autorelease 对象会导致自动释放池最终两次release 该对象,可能会使程序crash。

 

 

 


分享给朋友:
您可能感兴趣的文章:
随机阅读: