• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: NSFont errors
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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>)

  • Prev by Date: Re: working with font manager
  • Next by Date: Re: NSFont errors
  • Previous by thread: NSFont errors
  • Next by thread: Re: NSFont errors
  • Index(es):
    • Date
    • Thread