Re: Saving is so darn hard!
Re: Saving is so darn hard!
- Subject: Re: Saving is so darn hard!
- From: David Remahl <email@hidden>
- Date: Sun, 31 Mar 2002 19:45:29 +0200
>
I want to set up my program so that when it loads whatever the value of
>
theCheckBox would be the same as when you closed it (hence it saves). I've
>
been refering to multiple books but all of them just confuse me. I know
>
about the NSCoding protocal and to use NSArchiver and NSUnarchiver, but
>
those are the ones that get me. I know how to do encodeWithCoder and
>
initWithCoder but those NSArchivers and NSUnarchivers get me. Could someone
>
PLEASE show me how to implement those for saving a simple checkBox? Thanks
>
so much!
Hmm, saving just the state seems like a better idea...
[[NSUserDefaults standardUserDefaults] setBool:[cb intValue]
forKey:@"CBValue"];
Or
[coder encodeValueOfObjCType:@encode(BOOL) at:[cb intValue]];
/ David Remahl
_______________________________________________
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.