Apple Developer Connection
Member Login Log In | Not a Member? Contact ADC

Next Page > Hide TOC

Introduction to Memory Management Programming Guide for Cocoa

Contents:

Who Should Read This Document
Organization of This Document


Memory management, especially as it concerns Objective-C programs, is an important subject. Some of the more common problems encountered by novice application developers derive from poor memory management. Cocoa provides mechanisms and a policy to assist you in the proper creation, retention, and disposal of objects.

Memory management in Cocoa is largely object-oriented. This programming topic addresses the object-ownership policy and related techniques for creating, copying, retaining, and disposing of objects using “managed memory”.

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

The material in this programming topic relates to Objective-C objects and is of interest primarily to Objective-C programmers. 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.

Organization of This Document

This document contains the following articles:

Additional information about memory management and nib files can be found in Resource Programming Guide > Nib Files and Cocoa > “The Nib Object Life Cycle.”



Next Page > Hide TOC


Last updated: 2008-02-08




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.
Get information on Apple products.
Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Copyright © 2007 Apple Inc.
All rights reserved. | Terms of use | Privacy Notice