Re: NSFont errors
Re: NSFont errors
- Subject: Re: NSFont errors
- From: Fritz Anderson <email@hidden>
- Date: Fri, 25 Jul 2003 14:41:37 -0500
NSUserDefaults accepts only property-list-eligible values for
preferences. That's NSDate, NS/CFData, NSNumber or its subclasses,
NS/CFString; and NS/CFArrays and NS/CFDictionaries of eligible types
(including arrays and dictionaries of arrays and dictionaries).
So you have to encode anything else into NSData. You can refer to the
documentation at the head of NSUserDefaults if you need to review this.
-- F
On Friday, 25 July 2003, at 1:26 PM, Francisco Tolmasky wrote:
Ok, so I'm trying to have the font preference changed when a font gets
changed in the font panel, I have changeFont: working, and it looks
something like this:
- (void)changeFont:(id)sender
{
NSFont *theFont= [sender convertFont: [fontTextField font]];
[[[NSUserDefaults standardUserDefaults] setObject: theFont forKey:
FontPrefKey];
//...stuff
}
But for some reason I get an error like this:
*** -[NSUserDefaults setObject:forKey:]: Attempt to insert
non-property value '"CGS Monaco 10.00 pt. P [] (0x01d52480)
fobj=0x0029b020, spc=6.00"' of class 'NSCGSFont'.
I have no idea what's going wrong, anyone know?
_______________________________________________
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.
References: | |
| >NSFont errors (From: Francisco Tolmasky <email@hidden>) |