書名: Object–Oriented Programming with Swift 2作者名: Gastón C. Hillar本章字數: 131字更新時間: 2021-07-23 14:29:42
Test your knowledge
- Swift uses one of the following mechanisms to automatically deallocate the memory used by instances that aren't referenced anymore:
- Automatic Random Garbage Collector.
- Automatic Reference Counting.
- Automatic Instance Map Reduce.
- Swift executes an instance's deinitializer:
- Before the instance is deallocated from memory.
- After the instance is deallocated from memory.
- After the instance memory is allocated.
- A deinitializer:
- Can still access all of the instance's resources.
- Can only access the instance's methods but no properties.
- Cannot access any of the instance's resources.
- Swift allows us to define:
- Only one initializer per class.
- A main initializer and two optional secondary initializers.
- Many initializers with different arguments.
- Each time we create an instance:
- We must use argument labels.
- We can optionally use argument labels.
- We don't need to use argument labels.
推薦閱讀
- 演進式架構(原書第2版)
- Magento 2 Theme Design(Second Edition)
- Learning ArcGIS Pro
- Python機器學習算法與應用
- Orleans:構建高性能分布式Actor服務
- 寫給大家看的Midjourney設計書
- 數據分析與挖掘算法:Python實戰
- Azure for Architects
- Web前端開發精品課:HTML5 Canvas開發詳解
- Tkinter GUI Application Development Blueprints
- Hadoop MapReduce v2 Cookbook(Second Edition)
- Python Geospatial Analysis Cookbook
- Python接口自動化測試
- PHP程序開發參考手冊
- Android性能優化之道:從底層原理到一線實踐