Skip navigation.
 
mlRe: simple question about passing around pointers to objects
FROM : Andy Lee
DATE : Fri Jun 27 22:43:35 2008

On Jun 27, 2008, at 4:22 PM, Paul Archibald wrote:
> I am reading the Hillegass book, but I don't really see an example 
> of what I am tryng to do, although it seems like a very basic 
> question.

[...]
> But, as I have been trying to make an exhaustive test of what 
> "works" and what "crashes", I realize that just experimenting with 
> this is not enough, and I need a better theoretical understanding of 
> this stuff.


Programming by guesswork is a recipe for programs that don't work and 
are unmaintainable.  And memory management is an especially bad topic 
to guess about.

The Hillegass book is actually *full* of examples of what you're 
trying to do, which is create and use an object.  Find the section 
that explains retain and release and study it again.  In the latest 
edition it's around page 46.

> If you recognize this pattern and can tell me where to read more on 
> it, that would be great, too.


Start here:

<http://developer.apple.com/documentation/Cocoa/Conceptual/MemoryMgmt/index.html
>

--Andy

Related mailsAuthorDate
mlsimple question about passing around pointers to objects Paul Archibald Jun 27, 22:22
mlRe: simple question about passing around pointers to objects Andy Lee Jun 27, 22:43
mlRe: simple question about passing around pointers to objects Rob Ross Jun 27, 23:41
mlRe: simple question about passing around pointers to objects Daniel Richman Jun 28, 02:19
mlRe: simple question about passing around pointers to objects Clark Cox Jun 28, 02:59
mlRe: simple question about passing around pointers to objects Graham Cox Jun 28, 06:21
mlRe: simple question about passing around pointers to objects Graham Cox Jun 28, 06:29