- Objective-C Memory Management Essentials
- Gibson Tang Maxim Vasilkov
- 112字
- 2021-07-23 20:09:13
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
推薦閱讀
- Java面向?qū)ο笏枷肱c程序設(shè)計(jì)
- 深入理解Django:框架內(nèi)幕與實(shí)現(xiàn)原理
- Architecting the Industrial Internet
- INSTANT MinGW Starter
- Django:Web Development with Python
- Java開發(fā)入行真功夫
- Functional Programming in JavaScript
- Mastering ServiceNow(Second Edition)
- SQL Server 2016數(shù)據(jù)庫應(yīng)用與開發(fā)
- 劍指Java:核心原理與應(yīng)用實(shí)踐
- 從零開始學(xué)C#
- 鴻蒙OS應(yīng)用編程實(shí)戰(zhàn)
- The Statistics and Calculus with Python Workshop
- Deep Learning for Natural Language Processing
- Python無監(jiān)督學(xué)習(xí)