Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > Errors with NSUserDefaults

Errors with NSUserDefaults
Thread Tools
Professional Poster
Join Date: Dec 2000
Location: Chicago, Illinois
Status: Offline
Reply With Quote
May 31, 2001, 01:34 AM
 
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
     
tie
Professional Poster
Join Date: Feb 2001
Status: Offline
Reply With Quote
May 31, 2001, 02:12 AM
 
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
Reply With Quote
May 31, 2001, 02:36 AM
 
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
Reply With Quote
May 31, 2001, 03:22 AM
 
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
Reply With Quote
May 31, 2001, 08:46 AM
 
Ahh man, that would be so much easier if it did I thought as much was the problem. Thanks for the help.

F-bacher
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 12:08 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2