Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSMutableDictionary autorelease chrashes application




On Jul 18, 2008, at 1:48 PM, Andy Lee wrote:

On Jul 18, 2008, at 4:19 PM, mmalc crawford wrote:
On Jul 18, 2008, at 11:51 AM, Andy Lee wrote:

NSString *name = [aPerson name];
[aPerson setName:@"Fido"];
NSLog(@"Old name: %@", name);

And calling the return value from -name "autoreleased" would imply the second implementation, which might not be the case.


Indeed.

Out of curiosity, is this what the docs mean in the few places they say a return value is autoreleased, or is that just someone making the same old mistake?

I don't know for each individual case, but I suspect it's more likely to be the same old mistake. Each really ought to be investigated.


Moreover, saying that an object is "autoreleased" also implies the overhead of adding it to an autorelease pool, suggesting that it may be more expensive to retrieve the object than is actually the case.
Okay... I thought I had a reasonable suggestion but I see it was a pretty crappy one. I'll see if I can get comfortable with the ownership terminology.

Looking at your earlier reply, I take the point about "ownership" -- if someone can come up with something better, that would be great!

mmalc

_______________________________________________

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:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden
References: 
 >NSMutableDictionary autorelease chrashes application (From: Matthias Arndt <email@hidden>)
 >Re: NSMutableDictionary autorelease chrashes application (From: Robert Martin <email@hidden>)
 >Re: NSMutableDictionary autorelease chrashes application (From: Matthias Arndt <email@hidden>)
 >Re: NSMutableDictionary autorelease chrashes application (From: "Shawn Erickson" <email@hidden>)
 >Re: NSMutableDictionary autorelease chrashes application (From: "Shawn Erickson" <email@hidden>)
 >Re: NSMutableDictionary autorelease chrashes application (From: Andy Lee <email@hidden>)
 >Re: NSMutableDictionary autorelease chrashes application (From: Andy Lee <email@hidden>)
 >Re: NSMutableDictionary autorelease chrashes application (From: mmalc crawford <email@hidden>)
 >Re: NSMutableDictionary autorelease chrashes application (From: Andy Lee <email@hidden>)
 >Re: NSMutableDictionary autorelease chrashes application (From: mmalc crawford <email@hidden>)
 >Re: NSMutableDictionary autorelease chrashes application (From: Andy Lee <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.