Re: NSAttributedString with embedded image
Re: NSAttributedString with embedded image
- Subject: Re: NSAttributedString with embedded image
- From: Matt Neuburg <email@hidden>
- Date: Mon, 28 Mar 2005 10:51:10 -0800
On Sun, 27 Mar 2005 23:32:27 -0500, Craig Hunter <email@hidden>
said:
>Anybody have a code example of constructing an NSAttributedString with an
>embedded image and some text?
NSAttributedString* as;
NSTextAttachment* ta = [[NSTextAttachment alloc] init];
NSTextAttachmentCell* tac = [[NSTextAttachmentCell alloc] init];
[tac setImage: // whatever];
[ta setAttachmentCell: tac];
as = [NSAttributedString attributedStringWithAttachment: ta];
[ta release];
[tac release];
NSMutableAttributedString* mas =
[[NSMutableAttributedString alloc]
initWithAttributedString: as];
[mas appendAttributedString: // whatever];
m.
--
matt neuburg, phd = email@hidden, <http://www.tidbits.com/matt/>
A fool + a tool + an autorelease pool = cool!
AppleScript: the Definitive Guide
<http://www.amazon.com/exec/obidos/ASIN/0596005571/somethingsbymatt>
_______________________________________________
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