Re: Release understanding help…
Re: Release understanding help…
- Subject: Re: Release understanding help…
- From: Sherm Pendley <email@hidden>
- Date: Tue, 7 Dec 2004 00:20:11 -0500
On Dec 6, 2004, at 8:35 PM, Mark Dawson wrote:
(1) When I try to do a release on the "validChars", I get a crash
(msg_objc). Shouldn't I be releasing it? I DID create it with an
alloc…
You first create it with an alloc:
NSString* validChars = [[NSString alloc] initWithString:
@"0123456789mc/'\" "];
But then you replace it with an autoreleased NSString, and the one you
created above just leaks:
validChars = [validChars stringByAppendingString:[[NSUserDefaults
standardUserDefaults] objectForKey:NSDecimalSeparator]];
sherm--
Cocoa programming in Perl: http://camelbones.sourceforge.net
Hire me! My resume: http://www.dot-app.org
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden