Memory Management(Chapter 3 of Objective-C Phrasebook)
2011-02-26 21:52
302 查看
When you send an object an -autorelease message, it is added to the currently active NSAutoreleasePool instance. When this instance is destroyed, every object added to it is sent a -release message. The -autorelease message is a deferred -release message. You send it to an object when you no longer need a reference to it but something else might. This is a convention that is important to observe in your own classes. If someone creates an instance of one of your classes with a named constructor, he will expect not to have to release it. A typical named constructor would look something like the one at the start of this section.
相关文章推荐
- Working with Collections(Chapter 7 of Objective-C Phrasebook)
- Common Objective-C Patterns(Chapter 4 of Objective-C Phrasebook)
- An Objective-C Primer(Chapter 2 of Objective-C Phrasebook)
- Manipulating Strings(Chapter 6 of Objective-C Phrasebook)
- Numbers(Chapter 5 of Objective-C Phrasebook)
- Chapter_02 C语言的语言特性
- APUE阅读笔记(chapter 14)——高级I/O
- 【索引】Chapter 1. Algorithm Design_General Problem Solving Techniques_Exercises: Beginner
- Head First Java_Study Notes_Chapter 4 How Objects Behave
- chapter 28 Techniques for Writing C Functions
- C++ primer plus(sixth edition) 编程练习答案(answers for programing exercises)第六章(chapter 6) 5-9
- 【索引】Chapter 1. Algorithm Design :: Designing Efficient Algorithms :: Exercises: Beginner
- Chapter 14 Threads
- Chapter 3 | Stacks and Queues--栈解决汉诺塔问题
- chapter 2
- 《APUE》chapter 13 Deamon Process 学习笔记(加上自己的代码)
- (转) MapReduce Design Patterns(chapter 2 (part 1))(二)
- 《APUE》chapter 18 Terminal I/O 学习笔记(加上自己的代码)
- 《linux 内核完全剖析》 chapter 5 Linux内核体系结构
- 《linux 内核完全剖析》chapter 13 内存管理 (不含swap.c)