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

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
主站蜘蛛池模板: 汉沽区| 白山市| 乌兰察布市| 周至县| 汉寿县| 大荔县| 五常市| 新泰市| 平安县| 东宁县| 中山市| 丹寨县| 固原市| 葫芦岛市| 化州市| 唐河县| 巩义市| 咸宁市| 永丰县| 南康市| 郧西县| 德安县| 兖州市| 独山县| 莱芜市| 深泽县| 新疆| 绩溪县| 保康县| 岫岩| 大英县| 江孜县| 云和县| 中超| 康定县| 岱山县| 毕节市| 扬州市| 乡城县| 乌恰县| 邵武市|