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

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
主站蜘蛛池模板: 光泽县| 平陆县| 穆棱市| 绥宁县| 吉水县| 冀州市| 洛宁县| 门源| 修武县| 南昌市| 夏河县| 泗水县| 玉屏| 盖州市| 天津市| 信宜市| 阳春市| 阿合奇县| 醴陵市| 山东| 泗水县| 祁阳县| 洪洞县| 郎溪县| 万州区| 西充县| 兴海县| 静宁县| 霍林郭勒市| 娄底市| 惠水县| 东乌珠穆沁旗| 吉首市| 靖安县| 青冈县| 肇东市| 板桥市| 定结县| 华坪县| 马尔康县| 个旧市|