Re: Text attachments - making an NSTextAttachment unique?
Re: Text attachments - making an NSTextAttachment unique?
- Subject: Re: Text attachments - making an NSTextAttachment unique?
- From: Jérôme Laurens <email@hidden>
- Date: Fri, 28 Oct 2005 15:51:56 +0200
Le 28 oct. 05, à 12:39, Keith Blount a écrit :
So far, my concusions seem to be confirmed by tests...
It only happens when I insert two text attachments
next to each other. These attachments hold a cell
which holds an attibuted string. Even if I ensure that
these attributed strings are different, so that the
cells held by the attachments are not equal (and
therefore the attachments should not be equal), I
still get the same problem. If I parse through all the
text looking for NSAttachmentAttributeName using
attribute:atIndex:effectiveRange:, NSLogging the
attachment cell, I indeed find that I now have the
same cell at two places in the text (next to each
other) rather than two distinct instances. I do not
understand why this should be.
Martin - yes, the merging of attribute runs is exactly
what I'm talking about. Thanks for your suggestions -
I am very grateful that two text-gurus have replied.
:). Following your idea, I tried subclassing
NSTextAttachment and returning NO for -isEqual: but
this didn't help either. Also, just ensuring that one
character is selected in my code won't help, as I need
to take actions on the cells; they are not just there
for display. A note cell can be expanded or collapsed,
for instance. And given that the cell handles the
drawing, if the cell is asked to highlight itself, it
must do so in all the places in the text that it
exists, I think...
Any other suggestions would be much appreciated...
Many thanks,
Keith
Maybe you can feed the NSTextAttachment with virtual filenames
_______________________________________________
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