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

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
主站蜘蛛池模板: 萍乡市| 泰兴市| 佳木斯市| 广东省| 云南省| 三都| 顺义区| 吉首市| 平安县| 仁布县| 南澳县| 宝鸡市| 巩义市| 隆林| 攀枝花市| 原阳县| 容城县| 水城县| 深圳市| 英吉沙县| 宝山区| 黎城县| 南城县| 正阳县| 乐平市| 乌鲁木齐县| 湛江市| 沁源县| 神农架林区| 酒泉市| 永仁县| 郴州市| 中山市| 营山县| 文水县| 娱乐| 太康县| 云林县| 慈利县| 牙克石市| 三江|