• 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: Saving preferences tutorial
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Saving preferences tutorial


  • Subject: Re: Saving preferences tutorial
  • From: Jeff Harrell <email@hidden>
  • Date: Mon, 30 Jun 2003 20:25:43 -0500

I don't know of a tutorial, but it's really as simple as:

[[NSUserDefaults standardUserDefaults] setObject:@"someValue" forKey:@"someKey"];

You can do it with any object, such as a string as shown here, an NSColor, an NSArray, an NSDict, whatever. You can also use setBool:, setFloat:, or setInteger: instead if you want to store one of those values.

Now, mapping user defaults values and keys to UI elements is a job for a controller object.

Does that help at all? Feel free to email with further questions.

On Monday, June 30, 2003, at 07:34 PM, Chad Armstrong wrote:

Is there a good tutorial available on saving preferences? Of the one or two I've found, they seem a little more complicated than it seems like it should be. I would like the ability to just save a few values such as a radio button or color. Thanks.

Chad Armstrong
email@hidden
_______________________________________________
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.



--
email@hidden
http://homepage.mac.com/jharrell
_______________________________________________
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: Saving preferences tutorial
      • From: Chris Parker <email@hidden>
References: 
 >Saving preferences tutorial (From: Chad Armstrong <email@hidden>)

  • Prev by Date: Re: Saving preferences tutorial
  • Next by Date: Re: Saving preferences tutorial
  • Previous by thread: Re: Saving preferences tutorial
  • Next by thread: Re: Saving preferences tutorial
  • Index(es):
    • Date
    • Thread