• 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: odd behavior with NSError?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: odd behavior with NSError?


  • Subject: Re: odd behavior with NSError?
  • From: Jerry Krinock <email@hidden>
  • Date: Fri, 16 Oct 2009 11:00:43 -0700

On 2009 Oct 16, at 03:44, Kevin Bracey wrote:

If we get an NSError, or in the case of NSAppleScript an NSDictionary with the error description, what is the Retain count

The retain count of an object is equal to 1 for alloc + the number of - retain messages - the number of -release messages that the object has been sent. (I realize that's not the answer you wanted ... read on.)


and do we release it when we're done with it?

No, because you didn't alloc, copy or retain it.

I'd been not releasing them, I didn't allocate or copy it, but when I Build and Analyzed my code in 3.2 on Snow Leopard it said that I had a retain count of +1.

It had better be, because if it was not >= 1 it would be gone.

Am I leaking?

No.

Whoever retained it is responsible for releasing it. In this trivial case, *probably* whoever gave it to you autoreleased it. But use such conjectures for debugging only, never for design.

_______________________________________________

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


References: 
 >Re: odd behavior with NSError? (From: Kevin Bracey <email@hidden>)

  • Prev by Date: Re: A good Obc-C framework for sending email?
  • Next by Date: Re: odd behavior with NSError?
  • Previous by thread: Re: odd behavior with NSError?
  • Next by thread: Re: odd behavior with NSError?
  • Index(es):
    • Date
    • Thread