Re: NSColor + Bindings
Re: NSColor + Bindings
- Subject: Re: NSColor + Bindings
- From: Chris Suter <email@hidden>
- Date: Fri, 25 May 2007 21:11:10 +1000
On 25/05/2007, at 7:16 PM, Andrew James wrote:
Hi,
I seem to have this werid bug where my program locks up completely
when i use certain NSColors from a NSColorWell, the colors are
stored in the userdefaults and taken out to be read,
if ([[NSUserDefaults standardUserDefaults]
objectForKey:@"lockPasswordColour"] != nil) {
NSData * passwordColorPrefsData = [[NSUserDefaults
standardUserDefaults] objectForKey:@"lockPasswordColour"];
NSColor * passwordColor = [NSUnarchiver
unarchiveObjectWithData:passwordColorPrefsData];
[passwordField setTextColor:passwordColor];
[passwordColor release];
[passwordColorPrefsData release];
} else {
[passwordField setTextColor:[NSColor whiteColor]];
}
Is there a way to verify the color so i can catch it if its
incorrect or am i missing something
Read the memory management documentation. Both calls to release are
wrong and are almost certainly the cause of your lock-up.
- Chris
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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