- 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
推薦閱讀
- SPSS數(shù)據(jù)挖掘與案例分析應(yīng)用實(shí)踐
- 新一代通用視頻編碼H.266/VVC:原理、標(biāo)準(zhǔn)與實(shí)現(xiàn)
- 深入淺出WPF
- Java Web基礎(chǔ)與實(shí)例教程
- Kotlin Standard Library Cookbook
- 網(wǎng)店設(shè)計(jì)看這本就夠了
- 實(shí)戰(zhàn)Java高并發(fā)程序設(shè)計(jì)(第3版)
- TypeScript項(xiàng)目開發(fā)實(shí)戰(zhàn)
- 交互設(shè)計(jì)師成長手冊:從零開始學(xué)交互
- Java網(wǎng)絡(luò)編程實(shí)用精解
- 微信公眾平臺服務(wù)號開發(fā):揭秘九大高級接口
- VB語言程序設(shè)計(jì)教程(第2版)
- Python編程基礎(chǔ)
- Advanced Analytics with R and Tableau
- 軟件測試實(shí)用教程