Re: How to get the exact location and range for an Attachment present in NSTextView
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