• 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: releasing an object
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: releasing an object


  • Subject: Re: releasing an object
  • From: Graham Cox <email@hidden>
  • Date: Sat, 10 Oct 2009 21:36:41 +1100


On 10/10/2009, at 9:31 PM, Nick Rogers wrote:

Shall I get its retainCount and then release it that many times?


For heavens' sake, NO!

Ignore retain counts. They are not reliable evidence of anything you can use. Instead, just follow the rules:

http://developer.apple.com/mac/library/documentation/Cocoa/Conceptual/MemoryMgmt/Articles/mmRules.html

I'm doing alloc and initWithDictionary to get an instance of Volume.
I have to do [selectedPTVolume retain]; when allocing to get it to work properly.

Show your code. This sounds wrong, but without seeing the code it can't really be inferred from the description.





--Graham


_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: releasing an object
      • From: Nick Rogers <email@hidden>
References: 
 >releasing an object (From: Nick Rogers <email@hidden>)

  • Prev by Date: releasing an object
  • Next by Date: Removing an Object with A Certain Title from an NSTreeController.
  • Previous by thread: releasing an object
  • Next by thread: Re: releasing an object
  • Index(es):
    • Date
    • Thread