• 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: UserDefaults (Java)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: UserDefaults (Java)
      • From: Chris Parker <email@hidden>
  • Prev by Date: Getting the original moviebox in Cocoa
  • Next by Date: AppleScript and application attributes ?
  • Previous by thread: Re: UserDefaults (Java)
  • Next by thread: Re: UserDefaults (Java)
  • Index(es):
    • Date
    • Thread