Re: Inconsistent Memory Management Rules
Re: Inconsistent Memory Management Rules
- Subject: Re: Inconsistent Memory Management Rules
- From: Lloyd Dupont <email@hidden>
- Date: Mon, 14 Apr 2003 14:50:18 +1000
Absolutely !!!!
On Monday, April 14, 2003, at 02:43 PM, Jeffrey J Barbose wrote:
On Sunday, Apr 13, 2003, at 21:32 US/Pacific, John C. Randolph wrote:
NSString * string = [[NSString alloc]init];
string = [string stringByAppendingString:@"steve jobs"];
'string' is a pointer. In the line of code above, you've discarded
its previous value (the address of the object returned by your
alloc/init pair), and assigned it the address of an autoreleased
string (returned from -stringByAppendingString:)
So just as a technical point, would the previous value, discarded in
the stringByAppendingString assignment, be a leak?
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.