Re: Crash with extra [CFString release] after changing a bound value in NSTextField
Re: Crash with extra [CFString release] after changing a bound value in NSTextField
- Subject: Re: Crash with extra [CFString release] after changing a bound value in NSTextField
- From: Quincey Morris <email@hidden>
- Date: Tue, 08 Mar 2011 12:38:59 -0800
On Mar 8, 2011, at 12:24, John Link wrote:
> NSNumber *myNum = [[NSNumber alloc] init];
> myNum = [prefs valueForKey:MinimumValue]; // retrieve NSNumber from shared
> defaults
> // do stuff
> [myNum release];
>
> I thought I was releasing the NSNumber I had created, but if I understand
> correctly the second line just points myNumber at the autoreleased value
> returned from valueForKey. So in addition to the overrelease caused by the last
> line, the NSNumber I originally created is orphaned, right?
Right. :)
_______________________________________________
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:
This email sent to email@hidden