 |
 |
Errors with NSUserDefaults
|
 |
|
 |
|
Professional Poster
Join Date: Dec 2000
Location: Chicago, Illinois
Status:
Offline
|
|
I'm having this strange problem with NSUserDefaults, and I think I'm doing it just like the documentation says to. Here's what i do:
When a user changes a NSColorWell called colorO, I envoke the following method:
public void updatePrefs(NSObject sender)
{
NSUserDefaults.standardUserDefaults().setObjectFor Key(colorO.color(), "colorO");
}
and I get a signal 6 (SIGABRT) error when I click on the color well. Anyone know why?
Thanks,
F-bacher
|
|
|
| |
|
|
|
 |
|
 |
|
Professional Poster
Join Date: Feb 2001
Status:
Offline
|
|
A default's value can be only an NSData, NSString, NSArray, or NSDictionary. No?
[Edit: Are ObjC objects serializable, like in Java? Could be useful.]
[This message has been edited by tie (edited 05-31-2001).]
|
|
The 4 o'clock train will be a bus.
It will depart at 20 minutes to 5.
|
| |
|
|
|
 |
|
 |
|
Professional Poster
Join Date: Dec 2000
Location: Chicago, Illinois
Status:
Offline
|
|
Originally posted by tie:
A default's value can be only an NSData, NSString, NSArray, or NSDictionary. No?
[Edit: Are ObjC objects serializable, like in Java? Could be useful.]
[This message has been edited by tie (edited 05-31-2001).]
Ahh yes, you are correct. And yet, when I send in an NSArray object, I get the same error. Weird.
F-bacher
|
|
|
| |
|
|
|
 |
|
 |
|
Dedicated MacNNer
Join Date: Jan 2001
Location: Virginia, US
Status:
Offline
|
|
Um, the array can't contain an NSColor either (or any class besides NSString, NSData, NSArray, or NSDictionary).
One way is to use NSArchiver to get the NSData archive of the NSColor, and store that.
|
|
|
| |
|
|
|
 |
|
 |
|
Professional Poster
Join Date: Dec 2000
Location: Chicago, Illinois
Status:
Offline
|
|
Ahh man, that would be so much easier if it did  I thought as much was the problem. Thanks for the help.
F-bacher
|
|
|
| |
|
|
|
 |
 |
|
 |
|
|
|
|
|

|
|
 |
Forum Rules
|
 |
 |
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
 |
 |
 |
 |
|
 |
|