Next Page > Hide TOC

Introduction

Contents:

Who Should Read This Document
Organization of This Document


In any program you write, you must ensure that you manage resources effectively and efficiently. One such resource is your program’s memory. In an Objective-C program, you must make sure that objects you create are disposed of when you no longer need them.

In a complex system, it could be difficult to determine exactly when you no longer need an object. Cocoa defines some rules and principles that help making that determination easier.

Important: In Mac OS X v10.5 and later, you can use automatic memory management by adopting garbage collection. This is described in Garbage Collection Programming Guide.

Who Should Read This Document

You should read this document to learn about the object ownership policies and related techniques for creating, copying, retaining, and disposing of objects in a reference-counted environment.

Note: If you are starting a new project targeted at Mac OS X v10.5 and later, you should typically use garbage collection unless you have good reason to use the techniques described here.

This document does not describe details of allocating and initializing objects, and implementing initializer methods. These tasks are discussed in Allocating and Initializing Objects in The Objective-C 2.0 Programming Language.

Organization of This Document

This document contains the following articles:



Next Page > Hide TOC


© 2009 Apple Inc. All Rights Reserved. (Last updated: 2009-05-06)


Did this document help you?
Yes: Tell us what works for you.
It’s good, but: Report typos, inaccuracies, and so forth.
It wasn’t helpful: Tell us what would have helped.