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

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
主站蜘蛛池模板: 石棉县| 屏东县| 马山县| 汝阳县| 四会市| 安吉县| 凤庆县| 宁远县| 冷水江市| 辉县市| 浙江省| 邢台市| 华宁县| 洪湖市| 郧西县| 渝北区| 磴口县| 南阳市| 富源县| 凌源市| 莆田市| 彭山县| 平邑县| 思茅市| 乌鲁木齐县| 库车县| 玉林市| 贵阳市| 右玉县| 漯河市| 平昌县| 南华县| 云浮市| 天门市| 肇州县| 交城县| 房山区| 彭泽县| 宜兰市| 会理县| 嘉祥县|