• 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: Greg Guerin <email@hidden>
  • Date: Fri, 16 Oct 2009 11:18:44 -0700

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 and do we release it when we're done with it?

Wrong question. The retain count is not an ownership count. The right question is "Do I own it?" If you own it, you're responsible for releasing it. If you don't own it, you must not release 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. Am I leaking?

Any advice on this?


Find the word "NSError" on this page:

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

It's under the heading "Objects Returned by Reference".

  -- GG
_______________________________________________

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


  • Prev by Date: Re: odd behavior with NSError?
  • Next by Date: Re: NSURLRequest SSL Mac vs iPhone
  • Previous by thread: Re: odd behavior with NSError?
  • Next by thread: NSArrayController filtering
  • Index(es):
    • Date
    • Thread