
390 9 Chapter 18: Building Blocks and Types
Cocoa/Java:
NSUserDefaults defaults =
NSUserDefaul ts. standardUserDefaul ts ( ) ;
NSString val = defaults.stringForKey (myKey) ;
Cocoa / Objective-C"
NSUserDefaults *defaults = [
NSUserDefaults standardUserDefaults ] ;
NSString *val = [defaults stringForKey-myKey] ;
Carbon:
CFStringRef val = CFPreferencesCopyAppValue
(myKey, kCFPreferencesCurrentApplication
Creating Objects
There are some important differences between Java and Ob-
jective-C relating to the way in which objects are created. The
code snippets in this section demonstrate some of them.
The snippets also demonstrate ...