Re: dictionaryWithObjectsAndKeys
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