Saving arrays with NSUserDefaults?
Saving arrays with NSUserDefaults?
- Subject: Saving arrays with NSUserDefaults?
- From: Jonathan del Strother <email@hidden>
- Date: Tue, 29 Jun 2004 23:53:55 +0100
I'm having trouble saving an array into NSUserDefaults.
[ [NSUserDefaults standardUserDefaults] setObject:presets
forKey:@"GLPresets"];
'presets' is an NSMutableArray consisting of several of these:
@interface Preset : NSObject
{
NSString* name;
float intensity;
float sensitivity;
float fade;
float zoom;
float zoomRotation;
int numLines;
float r1,g1,b1;
float r2,g2,b2;
bool smooth;
bool glow;
bool cycle;
bool sharpOverlay;
int scaleSystem;
};
@end;
When I try to set the object in the preferences, I get this in the
console:
-[NSUserDefaults setObject:forKey:]: Attempt to insert non-property
value '<CFArray 0x54afe70 [0xa01900e0]>{type = immutable, count = 9,
values = (
0 : <Preset: 0x5492540>
1 : <Preset: 0x54b7960>
2 : <Preset: 0x54b6cc0>
3 : <Preset: 0x54924d0>
4 : <Preset: 0x54912f0>
5 : <Preset: 0x54b78e0>
6 : <Preset: 0x54b0860>
7 : <Preset: 0x54b7260>
8 : <Preset: 0x54afdb0>
)}' of class 'NSCFArray'.
Any ideas what I'm doing wrong?
Thanks,
Jon
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.