Re: Newbie: Proper objc style
Re: Newbie: Proper objc style
- Subject: Re: Newbie: Proper objc style
- From: Ondra Cada <email@hidden>
- Date: Mon, 10 May 2004 09:51:55 +0200
Hello,
On 10.5.2004, at 7:31, mmalcolm crawford wrote:
>
By conventionally, however, objects should always be returned
>
autoreleased unless otherwise documented
Correct me please if I am wrong, but I believe that this is not the
convention: unless I've missed something important, the convention says
just the following:
>
it is the responsibility of the method caller to retain them if they
>
want
which effectively means the returned object can be either autoreleased,
OR shared (a singleton), OR whatever (e.g., if it makes sense in a
particular case, the vendor may keep track of vended objects and
release them when some special conditions are met).
The only invariant is that the receiving code is not assumed to release
the object (unless it retained it). The means of achieving that can
differ and are not fixed anyhow; vending an autoreleased object is just
the most common one, but by far not the only one.
Or am I completely wrong?
---
Ondra Hada
OCSoftware: email@hidden
http://www.ocs.cz
private email@hidden
http://www.ocs.cz/oc
[demime 0.98b removed an attachment of type application/pkcs7-signature which had a name of smime.p7s]
_______________________________________________
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.