Skip navigation.
 
mlRe: Seeking comments: an Objective-C reference card for Java programmers
FROM : Ken Ferry
DATE : Tue Nov 30 21:58:23 2004

On Sat, 27 Nov 2004 15:51:47 -0800, Dylan McNamee <<email_removed>> wrote:
>
> If anyone finds it useful, that's great.
>
> I'd also appreciate any feedback / errata / suggestions for improvement.
> I do want to keep it to one side of one page, though.
>
> Here's the file:  http://www.mecodegoodsomeday.com/ObjectiveCRef.pdf


Looks very useful!

You could clarify the use of autorelease.  Maybe show that the
principal use is to return an object without transferring ownership to
the calling function.

The current text,
"autorelease performs a release at some point in the future after the
current stack frame is exited"

doesn't make it clear that the object will survive being returned.

Of course it's hard to compose clear, concise text.  How about,
"Only methods that start with init, new, copy or retain return objects
that have to be released by the caller.  To return an object that
doesn't need releasing, it's often useful to send the object the
autorelease message.  Autorelease works like a deferred release."

-Ken

Related mailsAuthorDate
mlSeeking comments: an Objective-C reference card for Java programmers Dylan McNamee Nov 28, 00:51
mlRe: Seeking comments: an Objective-C reference card for Java programmers M. Uli Kusterer Nov 28, 05:09
mlRe: Seeking comments: an Objective-C reference card for Java programmers Andrew Thompson Nov 30, 06:40
mlRe: Seeking comments: an Objective-C reference card for Java programmers Ken Ferry Nov 30, 21:58