• 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
Problem with NSColor since 10.2
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Problem with NSColor since 10.2


  • Subject: Problem with NSColor since 10.2
  • From: Frank Blome <email@hidden>
  • Date: Wed, 28 Aug 2002 09:28:10 +0200

Another question on the new DevTools from Jaguar (they really drive me crazy). These part of the source code has worked fine before I had upgraded:

I defined in my .h:
...
NSData *allowColor;
...
-------------------
// While loading the Preferences I do:
...
allowColor = [defaults objectForKey: @"AllowColor"];
if (allowColor == nil)
allowColor = [NSArchiver archivedDataWithRootObject:[NSColor blueColor]];
[colorWellAllow setColor:[NSUnarchiver unarchiveObjectWithData:allowColor]];
...
-------------------
// When I'm saving the color, I do:
- (IBAction)setAllowColor:(id)sender
{
NSColor *color = [sender color];
allowColor = [NSArchiver archivedDataWithRootObject:color];
[[NSUserDefaults standardUserDefaults] setObject:allowColor forKey: @"AllowColor"];

[self loadPreferences];
}
-------------------
// Finally while displaying the rows in a NSTableView:
- (void)tableView:(NSTableView*)aTableView
willDisplayCell:(id)cell
forTableColumn:(NSTableColumn*)aTableColumn
row:(int)rowIndex
{
...
else if ([[cell stringValue] hasPrefix:@"ALLOW"])
{
[cell setTextColor: [NSUnarchiver unarchiveObjectWithData: allowColor]];
}
...
}

Anyone knows whats goin' on here? Have I done a general mistake, or is the code OK?

Thank you for helping me out of the swamp,
Frank
_______________________________________________
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.

  • Follow-Ups:
    • Re: Problem with NSColor since 10.2
      • From: Ondra Cada <email@hidden>
  • Prev by Date: Re: Problems with DevTools from 10.2
  • Next by Date: Re: How to create a Choose Panel
  • Previous by thread: Re: Problems with DevTools from 10.2
  • Next by thread: Re: Problem with NSColor since 10.2
  • Index(es):
    • Date
    • Thread