• 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: How to get the exact location and range for an Attachment present in NSTextView
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to get the exact location and range for an Attachment present in NSTextView


  • Subject: Re: How to get the exact location and range for an Attachment present in NSTextView
  • From: Graham Cox <email@hidden>
  • Date: Tue, 20 Sep 2011 08:33:59 +1000

I haven't tried, but off the top of my head it looks like a candidate for using:

[NSAttributedString enumerateAttribute:inRange:options:usingBlock:]

with NSAttachmentAttributeName as the attribute.


--Graham


On 20/09/2011, at 5:23 AM, Sandeep Mohan Bhandarkar wrote:

> Hi All,
>
> Can anyone tell me if it is possible to get the exact range and location of an attachment present in a NSTextView. Here is what i am looking for
>
> 1) Attach images, Documents inline in a NSTextView using NSAttributedString.
> 2) Get the exact location for the Attachment in the entire text view string.
>
> Part 1 is working for me. but I need some help on how point 2 can be done got the following methods online
>
> [[NSTextView attributedString] containsAttachment]
>
> but this will only tell me if there is an attachment present. I need to know where the attachment is present in the entire text of the NSTextView.

_______________________________________________

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

References: 
 >How to get the exact location and range for an Attachment present in NSTextView (From: Sandeep Mohan Bhandarkar <email@hidden>)

  • Prev by Date: Re: iOS App Ready to Upload ???
  • Next by Date: NSArrayController and NSTableView
  • Previous by thread: How to get the exact location and range for an Attachment present in NSTextView
  • Next by thread: NSArrayController and NSTableView
  • Index(es):
    • Date
    • Thread