Chapter 9
MemoryManagement
next on our plate is memory management using Objective-C and Cocoa (yum!). Memory management is a part of a more general problem in programming called resource management. Every computer system has finite resources for your program to use. These include memory, open files, network connections, and so on. If you use a resource, such as by opening a file, you need to clean up after yourself (in this case, by closing the file). If you keep on opening files but never close them, you'll eventually run out of file capacity. Think about your public library. If everyone borrowed books but never returned them, eventually the library would close because it would have no more books, and everybody would be sad. Nobody wants that. ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access