自动释放对象和自动释放池(2)

How does -autorelease work?
• Object is added to current autorelease pool
• Autorelease pools track objects scheduled to be released
  ■ When the pool itself is released, it sends -release to all its objects
• UIKit automatically wraps a pool around every event dispatch

 

 

 

 

 

 

 

 

  

posted @ 2011-07-21 15:51  AlexFan  阅读(253)  评论(0编辑  收藏  举报