• 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 Q] Memory Management in Cocoa
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Newbie Q] Memory Management in Cocoa


  • Subject: Re: [Newbie Q] Memory Management in Cocoa
  • From: Ondra Cada <email@hidden>
  • Date: Tue, 5 Nov 2002 23:33:06 +0100

On Tuesday, November 5, 2002, at 10:17 , Sherm Pendley wrote:

(2) you own an object that you introduced into your application
by calling alloc, allocWithZone:, copy, or copyWithZone: yourself (I'm
leaving something out here; what is it?).

retain

mutableCopy (and new).

Although, I don't think of objects that have been retained as being "owned" by my code. The owner is whatever code allocated or copied the object. My code is just renting the object for a while - with an option to buy if the owner decides to release it. ;-)

I'd rather look at the object as shared. Creating it and retaining it seems to me equivalent in the sense that both chunks of code -- the one who alloc/init'd, and the one who retained -- have precisely the same rights and duties so far as the object in question is concerned. If you insist of speaking ownership, then the object has more owners at once ;)
---
Ondra Cada
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.
  • Follow-Ups:
    • RE: [Newbie Q] Memory Management in Cocoa
      • From: "Jonathan E. Jackel" <email@hidden>
References: 
 >Re: [Newbie Q] Memory Management in Cocoa (From: Sherm Pendley <email@hidden>)

  • Prev by Date: Re: NSTextView Background Color
  • Next by Date: Re: [Newbie Q] Memory Management in Cocoa
  • Previous by thread: Re: [Newbie Q] Memory Management in Cocoa
  • Next by thread: RE: [Newbie Q] Memory Management in Cocoa
  • Index(es):
    • Date
    • Thread