- Hands-On Design Patterns with Swift
- Florent Vilmart Giordano Scalzo Sergio De Simone
- 70字
- 2021-07-02 14:45:07
Fixing the leak
Now that we've seen a simple leak, we have to change our implementation, in order to prevent the leaks from occurring. In our case, this can lead to other unexpected behavior. We have multiple options to resolve this particular self reference, as follows:
- Using weak
- Using unowned
- Ensuring that we never set ref = self
Let's investigate the solutions that involve weak and unowned.
推薦閱讀
- Mastering Ninject for Dependency Injection
- 數(shù)據(jù)庫開發(fā)實踐案例
- PySpark大數(shù)據(jù)分析與應(yīng)用
- 深入淺出MySQL:數(shù)據(jù)庫開發(fā)、優(yōu)化與管理維護(hù)(第2版)
- Hands-On Mathematics for Deep Learning
- gnuplot Cookbook
- INSTANT Apple iBooks How-to
- 數(shù)據(jù)庫原理與應(yīng)用
- 編寫有效用例
- 聯(lián)動Oracle:設(shè)計思想、架構(gòu)實現(xiàn)與AWR報告
- 二進(jìn)制分析實戰(zhàn)
- Doris實時數(shù)倉實戰(zhàn)
- 改變未來的九大算法
- 中國云存儲發(fā)展報告
- Spring Boot 2.0 Cookbook(Second Edition)