• 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: Colors and NSUserDefaults
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Colors and NSUserDefaults


  • Subject: Re: Colors and NSUserDefaults
  • From: Matt Judy <email@hidden>
  • Date: Mon, 08 Jul 2002 01:19:20 -0700

You should archive the color into data first. Something along these lines is effective:

[[NSUserDefaults standardUserDefaults] setObject:[NSArchiver archivedDataWithRootObject:myColor] forKey:@"savedColor"];

To restore:

myColor = [NSUnarchiver unarchiveObjectWithData:[[NSUserDefaults standardUserDefaults] dataForKey:@"savedColor"]]

--Matt

Jeremy Dronfield wrote:
I'm trying to put a colour value into my NSUserDefaults object. I tried using:

[prefs setObject:[myColorWell color] forKey:@"ColorSetting"];

which gives me a signal 10. There's nothing wrong with my prefs object; it puts other values into the .plist file perfectly well. Also, myColorWell performs its function in the application just fine, so there can't be a problem with that. The only other default setting methods are bool, float and integer, none of which are appropriate.
- Jeremy.
_______________________________________________
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.
_______________________________________________
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: Colors and NSUserDefaults
      • From: Jeremy Dronfield <email@hidden>
References: 
 >Colors and NSUserDefaults (From: Jeremy Dronfield <email@hidden>)

  • Prev by Date: ld: undefined symbol _main (but a main does exist)
  • Next by Date: Re: ld: undefined symbol _main (but a main does exist)
  • Previous by thread: Re: Colors and NSUserDefaults
  • Next by thread: Re: Colors and NSUserDefaults
  • Index(es):
    • Date
    • Thread