On 21/11/2008, at 3:45 PM, Jim Correia wrote:

On Nov 20, 2008, at 11:36 PM, Kiel Gillard wrote:

While your discovery is interesting, maybe we're not supposed to know how NSString is implemented. Even if on your computer you do not get double free messages in your run log, a crash or whatever, I'm all for keeping the memory management rules simple and treating anything that doesn't contain "alloc] init...]" or "new]" as autoreleased.

The memory management rules are already simple. There are three rules.

Making up your own interpretations of them, such as "treating anything that doesn't contain 'alloc] init]' or 'new]' as autoreleased", is not only incorrect, but gets in the way of a fundamental understanding of how things work.

On their own is incorrect but in the context of the message I was replying to, it was not.

What happens to an object before it is handed to you is completely irrelevant. It doesn't matter. Thinking about what the method might have done with the object is a waste of mental effort. The only thing which is important is whether or not you are responsible for releasing the object.

I totally agree.



Jim

_______________________________________________

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/kiel.gillard%40gmail.com

This email sent to [EMAIL PROTECTED]

_______________________________________________

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 [EMAIL PROTECTED]

Reply via email to