• 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
Getting an index for NSMutableAttributed string using tags in RTF
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Getting an index for NSMutableAttributed string using tags in RTF


  • Subject: Getting an index for NSMutableAttributed string using tags in RTF
  • From: Pax <email@hidden>
  • Date: Sun, 20 Apr 2014 10:43:37 +0100

I have an NSTextView which is being populated using RTF:

    if ([self getContent:@"RTF"]&&useformatting)
    {
        [attributedContent appendAttributedString:[[NSAttributedString alloc] initWithRTF:[self getContent:@"RTF"] documentAttributes:NULL]];
    }

This works beautifully except that the RTF string references images:

{\*\htmltag84 <img border=0 width=224 height=51 id="_x0000_i1033" src="cid:email@hiddenB20" alt="LH_logo600r1idx">}\htmlrtf {\chbrdr\brdrsh LH_logo600r1idx}\htmlrtf0

I would like to make sure that the images are placed into the RTF correctly.  I thought I might be able to do it by saving the image to a cache folder and specifying a root (as WebKit's loadHTMLString does), but this isn't available in NSTextView or NSMutable String.

Second, I wondered if there's a way of getting the index of the last displayed character before the image from the RTF itself.

Does anyone have any ideas how this might be achieved?  As usual, all assistance gratefully received!

_______________________________________________

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


  • Follow-Ups:
    • Re: Getting an index for NSMutableAttributed string using tags in RTF
      • From: Martin Wierschin <email@hidden>
  • Prev by Date: Re: Strange toolbar/view/resize cursor interaction
  • Next by Date: ARC Retain Cycles
  • Previous by thread: Detecting screen capture in progress
  • Next by thread: Re: Getting an index for NSMutableAttributed string using tags in RTF
  • Index(es):
    • Date
    • Thread