• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: NSAttributedString with embedded image
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Prev by Date: Re: NSTableView and memory management problem.
  • Next by Date: Re: Apple's Code Level Support
  • Previous by thread: Re: NSAttributedString with embedded image
  • Next by thread: direction for control-drag - connection application
  • Index(es):
    • Date
    • Thread