• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: NSColor + Bindings
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

References: 
 >NSColor + Bindings (From: Andrew James <email@hidden>)

  • Prev by Date: NSDocumentController Question
  • Next by Date: binding crash when not inlined
  • Previous by thread: NSColor + Bindings
  • Next by thread: NSTreeController bound selection issue
  • Index(es):
    • Date
    • Thread