Re: UserDefaults (Java)
Re: UserDefaults (Java)
- Subject: Re: UserDefaults (Java)
- From: Nick Müller <email@hidden>
- Date: Thu, 27 Dec 2001 12:53:00 +0100
On 26.12.2001 at 19:11 Uhr, Simon Wright wrote:
>
So, I think my question is: how can I get an integer and a boolean
>
into my NSMutableDictionary?
Why do you put a Dictionary into user defaults? UserDefaults _is_ a
dictionary.
Out of my head (I quit Java for Cocoa due to some missing API)
NSUserDefaults myDefaults = NSUserDefaults.standardUserDefaults();
myDefaults.setIntegerForKey(1, "intKey");
and
int i = myDefaults.integerForKey("intKey");
This means, that you do not have to put an NSDictionary into the
defaults but simply use the wrappers to put types like boolean and int
into a dictionary (that dictionary beeing NSUserDefaults).
HTH,
Nick
PS:
I can only advise to quit coding in Java. I learned it the hard way.It
took me one month to rewrite an nearly finished Java-project into Obj-C.
There are simply some API-functions missing in NSTableView that make it
impossible to do everything that is possible with Obj-C.
Furthermore, you will not find enough Examples and nearly no support in
eMail-lists like here.
.........................................
logic tools
WebObjects // Web Authoring // Perl
Nick Mueller // Muenchen // Germany