Re: Accessor methods and (auto)release <Memory trail>
Re: Accessor methods and (auto)release <Memory trail>
- Subject: Re: Accessor methods and (auto)release <Memory trail>
- From: Ondra Cada <email@hidden>
- Date: Fri, 2 Aug 2002 17:45:59 +0200
On Wednesday, July 31, 2002, at 07:27 , Ali Ozer wrote:
-getter { return [[instance retain] autorelease]; }
...
I am concerned about the more subtle case...
...
Of course there are exceptions...
Well I still wonder... I've rigged a simple class which reports
retains/(auto)releases, and tried it to set into NSMutableArray, NSTask
(as launchPath), NSBox, NSButton, NSCell (as title), NSTextField, NSText
(as contents), and NSWindow (as title).
It seems *none* of them uses the above pattern. Some just retain and
return the object directly; other copy and return the copy directly, some
make a string using description (nice!) and return it directly.
So, is the above pattern (getter which retains and autoreleases) used in
Cocoa at all? Or, is it just a theoretically correct, but practically for
diverse reasons never (or extremely rarely) used one?
Thanks alot,
---
Ondra Hada
OCSoftware: email@hidden
http://www.ocs.cz
private email@hidden
http://www.ocs.cz/oc
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.