Re: Saving preferences tutorial
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.