Re: Problems with NSFont and (NSFont *)fontWithName:(NSString *)fontName size:(float)fontSize
Re: Problems with NSFont and (NSFont *)fontWithName:(NSString *)fontName size:(float)fontSize
- Subject: Re: Problems with NSFont and (NSFont *)fontWithName:(NSString *)fontName size:(float)fontSize
- From: Ryan Bates <email@hidden>
- Date: Mon, 16 Feb 2004 08:29:21 -0800
From the documentation:
"The dictionary must contain only property list objects (NSData,
NSDate, NSNumber, NSString, NSArray, or NSDictionary objects)."
<
http://developer.apple.com/documentation/Cocoa/Reference/Foundation/
ObjC_classic/Classes/NSDictionary.html>
You will need to archive the NSColor and NSFont objects before adding
them to the dictionary. Before asking how to do that, read this. : )
<
http://developer.apple.com/documentation/Cocoa/Conceptual/Archiving/
index.html>
Ryan
On Feb 16, 2004, at 6:42 AM, Roberto Sobachi wrote:
I've got problems assign to NSFont a font and size.
I need to insert into a NSDictionary a NSFont class, but when I start
application it returns that NSFont is nil.
This is my code:
NSFont *fontForString = [NSFont fontWithName:@"Times-Roman" size:9.0];
NSMutableDictionary *myDictionary = [NSMutableDictionary
dictionaryWithObjectsAndKeys: [NSColor whiteColor],
NSForegroundColorAttributeName, fontForString, NSFontAttributeName];
Roberto Sobachi
developer
http://www.xidiar.com
_______________________________________________
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.
_______________________________________________
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.