Re: dictionaryWithObjectsAndKeys
Re: dictionaryWithObjectsAndKeys
- Subject: Re: dictionaryWithObjectsAndKeys
- From: email@hidden
- Date: Sat, 9 Oct 2010 14:01:51 -0600
Yeah. I was way wrapped around the axle.
This works just fine:
NSMutableParagraphStyle *pStyle = [[NSMutableParagraphStyle new]
autorelease];
[pStyle setAlignment:NSRightTextAlignment];
m_textRightAttributes = [NSDictionary dictionaryWithObjectsAndKeys:
[NSFont systemFontOfSize:12.0], NSFontAttributeName, pStyle,
NSParagraphStyleAttributeName, nil];
[m_textRightAttributes retain];
On Oct 9, 2010, at 1:49 PM, Quincey Morris wrote:
On Oct 9, 2010, at 12:30, email@hidden wrote:
m_textAttributes = [NSDictionary dictionary];
[m_textAttributes setObject:[NSFont systemFontOfSize:12.0]
forKey:NSFontAttributeName];
NSMutableParagraphStyle *pStyle = [[NSMutableParagraphStyle new]
autorelease];
[pStyle setAlignment:NSRightTextAlignment];
[m_textAttributes setObject:pStyle
forKey:NSParagraphStyleAttributeName];
Is that really your code? You're invoking 'setObject:forKey:' on an
immutable NSDictionary.
Either you're ignoring a compiler warning, or you have compiler
warnings turned off. Neither seems like a very good idea.
_______________________________________________
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
_______________________________________________
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