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 (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to