Re: drawAtPoint?
Re: drawAtPoint?
- Subject: Re: drawAtPoint?
- From: "M. Uli Kusterer" <email@hidden>
- Date: Wed, 9 Mar 2005 07:13:52 +0100
At 19:26 Uhr -0800 08.03.2005, Mark Dawson wrote:
NSMutableDictionary *attributes = [[NSMutableDictionary alloc] init];
[attributes setObject:[NSFont fontWithName:@"Times" size:18]
forKey:NSFontAttributeName];
Shorter:
NSDictionary* attributes = [NSDictionary dictionaryWithObjectsAndKeys:
[NSFont fontWithName:@"Times" size:18],
NSFontAttributeName,
nil ];
[[[NSString alloc] initWithString: @"TEST"]
drawAtPoint:NSMakePoint(0, imageBounds.size.height/2),
withAttributes:attributes];
You have a stray comma here after the closing bracket.
Oh, and you can just use
[@"TEST" drawAtPoint: NSMakePoint(0, imageBounds.size.height/2)
withAttributes:attributes];
A string constant is a full-blown object in Objective C and you can
send it messages directly.
--
Cheers,
M. Uli Kusterer
------------------------------------------------------------
"The Witnesses of TeachText are everywhere..."
http://www.zathras.de
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
References: | |
| >drawAtPoint? (From: Mark Dawson <email@hidden>) |