• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Newbie: Proper objc style
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.


  • Follow-Ups:
    • Re: Newbie: Proper objc style
      • From: mmalcolm crawford <email@hidden>
References: 
 >Newbie: Proper objc style (From: Jorge Martins <email@hidden>)
 >Re: Newbie: Proper objc style (From: mmalcolm crawford <email@hidden>)
 >Re: Newbie: Proper objc style (From: Jorge Martins <email@hidden>)
 >Re: Newbie: Proper objc style (From: mmalcolm crawford <email@hidden>)

  • Prev by Date: Re: Newbie: Proper objc style
  • Next by Date: Re: Newbie: Proper objc style
  • Previous by thread: Re: Newbie: Proper objc style
  • Next by thread: Re: Newbie: Proper objc style
  • Index(es):
    • Date
    • Thread