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

NSUserDefaults and custom classes


  • Subject: NSUserDefaults and custom classes
  • From: "Devraj Mukherjee" <email@hidden>
  • Date: Sun, 15 Jul 2007 22:35:44 +1000

Hi everyone,

To store user defaults I have created an object that contains strings
and numbers as instances variables. I plan to write this object to the
as a user defaults object.

From a design perspective, should I have another class write and read
this object to the user defaults or is it OK to have the object write
and read itself from the user defaults space.

The class interface looks like


@interface MyCustomDefaults : NSObject {

	NSString	* userName;
	NSString	* password;
	NSString	* hostName;
	NSNumber	* port;

}

- (id) init;
- (id) initFromUserDefaults;
- (void) writeAsUserDefaults;

Thanks for your time.

--
"I never look back darling, it distracts from the now", Edna Mode (The
Incredibles)
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: NSUserDefaults and custom classes
      • From: Mike Abdullah <email@hidden>
  • Prev by Date: Preference application
  • Next by Date: Re: NSApp's run method and menus...
  • Previous by thread: Re: Preference application
  • Next by thread: Re: NSUserDefaults and custom classes
  • Index(es):
    • Date
    • Thread