
Signature
Delete this to reply directly.
> I want to set up some user defaults in an application, but I keep
> getting an address check when I go to regirster the defaults. This is
[quoted text clipped - 32 lines]
> return [[[MyKeyCode alloc] initWithCommandKey:newKey
> andModifier:newModifiers] autorelease;
missing close ']'
> //^^^^^^^^^^^^^^^^^ The problem?
> }
[quoted text clipped - 13 lines]
> [[NSUserDefaults standardUserDefaults] registerDefaults:defaults]; // <<
> ADDRESS CHECK
You are putting an object into UserDefaults that UserDefaults can't handle.
See
file:///Developer/ADC%20Reference%20Library/documentation/Cocoa/Conceptual/UserDefaults
which says:
Note that a default's value can be only property list objects:
NSData, NSString, NSNumber, NSDate, NSArray, or NSDictionary.
That document goes on to describe how you deal with storing other
information in UserDefaults, using NSColor as an example.
Nick Tamburri - 15 Nov 2007 19:37 GMT
> You are putting an object into UserDefaults that UserDefaults can't handle.
> See
[quoted text clipped - 8 lines]
> That document goes on to describe how you deal with storing other
> information in UserDefaults, using NSColor as an example.
I see.
I read about NSColor's limitation in Hillegass' book, but I was lead
to believe that the "problem" was with NSColor itself, not a
limitation of NSUserDefaults.
Thanks.
/nt

Signature
Delete this to email directly.