- Objective-C Memory Management Essentials
- Gibson Tang Maxim Vasilkov
- 294字
- 2021-07-23 20:09:11
Why do we need memory management in Objective-C?
It does not matter what programming language is being used; the question of memory management always persists. In general, it is a question of resource management that cannot be avoided because memory is always a limited resource.
The scripting languages and Java, where memory management is handled by the virtual machine or application (where it is hidden from the code), are not always effective enough. While it is easier for the programmer this way, it can have a negative impact on resources, since you don't have an absolute control of it and there are objects still "living" when we don't need them anymore, plus these "living" objects still occupy precious memory space, which can be used by other objects. Additionally, depending on what you ask, another opinion is that an automatic memory management is the only right way to go.
Such talks usually start discussions like "Which is the best programming language?" and" What is the best way of memory management?". Let's leave that meaningless business for blogs' and forums' "Holy-Wars". Every tool has it's use in the correct context and Objective-C memory management concept is quite efficient in terms of both time cost savings and resource saving.
The memory in Objective-C, is managed in a different way from some of the widespread languages such as C/C++, Java, or C#, which are typically taught in schools as it introduces new concepts such as object ownership. Memory management is crucial for devices that run on a limited amount of memory such as mobile phones, smart watches, and so on, since effective memory management will allow you to squeeze every ounce of performance needed to run efficiently on these small devices, where memory is scarce on these devices.
- GeoServer Cookbook
- LabVIEW程序設(shè)計(jì)基礎(chǔ)與應(yīng)用
- INSTANT OpenCV Starter
- Python入門很簡(jiǎn)單
- Android開發(fā)案例教程與項(xiàng)目實(shí)戰(zhàn)(在線實(shí)驗(yàn)+在線自測(cè))
- iOS開發(fā)實(shí)戰(zhàn):從入門到上架App Store(第2版) (移動(dòng)開發(fā)叢書)
- 第一行代碼 C語(yǔ)言(視頻講解版)
- 案例式C語(yǔ)言程序設(shè)計(jì)實(shí)驗(yàn)指導(dǎo)
- OpenCV Android Programming By Example
- Oracle Data Guard 11gR2 Administration Beginner's Guide
- JSP應(yīng)用與開發(fā)技術(shù)(第3版)
- Tkinter GUI Programming by Example
- Python程序設(shè)計(jì)現(xiàn)代方法
- Learning Swift
- Prezi Cookbook