官术网_书友最值得收藏!

Chapter 3. Using Autorelease Pools

Consider that you are returning an object you've created (and therefore own) to a caller. If it's released inside your method, the returning object will be an invalid one. On the other hand, there is the basic rule that you have to release the objects you own; then, how do you release them? Simply put the object in the autorelease pool. The object is then released when the autorelease pool is drained.

We will cover the following topics in this chapter:

  • Understanding the autorelease pool mechanism
  • How autorelease pool helps
  • Autoreleased classes
  • Autoreleased pool blocks and threads
  • Memory model in Objective-C
  • ARC with weak references
主站蜘蛛池模板: 普陀区| 农安县| 墨江| 西畴县| 筠连县| 山丹县| 宜宾市| 余姚市| 龙南县| 夹江县| 宁远县| 屏南县| 东明县| 诸暨市| 黎城县| 河池市| 广安市| 丹巴县| 措美县| 泗水县| 阿城市| 桐城市| 宜丰县| 合水县| 南平市| 罗源县| 宜兴市| 长岭县| 澳门| 阿城市| 邳州市| 陇西县| 全州县| 吉林市| 林西县| 清新县| 成安县| 当阳市| 新疆| 滨州市| 康保县|