• 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: dictionaryWithObjectsAndKeys
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: dictionaryWithObjectsAndKeys


  • Subject: Re: dictionaryWithObjectsAndKeys
  • From: Ken Thomases <email@hidden>
  • Date: Sat, 9 Oct 2010 14:19:27 -0500

On Oct 9, 2010, at 2:05 PM, email@hidden wrote:

> I want to make a NSDictionary of text  attributes to apply to text being drawn in a NSTextFieldCell.
>
> This
>
> m_textAttributes = [NSDictionary dictionaryWithObjectsAndKeys: [NSFont systemFontOfSize:12.0], NSFontAttributeName, NSRightTextAlignment, NSTextAlignment,  nil];
>
> gives this error:
>
> error: syntax error before 'NSTextAlignment'

NSRightTextAlignment is not an object and so can't be stored in a dictionary.  You could wrap it in an NSNumber.  I don't know to what purpose you intend to put the resulting dictionary.  That ultimate use would dictate whether an NSNumber can be used.

Regards,
Ken

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: dictionaryWithObjectsAndKeys
      • From: email@hidden
References: 
 >dictionaryWithObjectsAndKeys (From: email@hidden)

  • Prev by Date: Re: main window disappears on resize
  • Next by Date: Re: dictionaryWithObjectsAndKeys
  • Previous by thread: dictionaryWithObjectsAndKeys
  • Next by thread: Re: dictionaryWithObjectsAndKeys
  • Index(es):
    • Date
    • Thread