• 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: Text attachments - making an NSTextAttachment unique?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Text attachments - making an NSTextAttachment unique?


  • Subject: Re: Text attachments - making an NSTextAttachment unique?
  • From: Keith Blount <email@hidden>
  • Date: Fri, 28 Oct 2005 03:39:46 -0700 (PDT)

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

--- Douglas Davidson <email@hidden> wrote:

> Text attachments compare as equal only if they are
> identical, so I'm
> not sure why you're seeing this.  Try investigating
> it a bit more to
> find out what's going on in detail.
>
> Douglas Davidson
>
>





__________________________________
Yahoo! Mail - PC Magazine Editors' Choice 2005
http://mail.yahoo.com
 _______________________________________________
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

  • Follow-Ups:
    • Re: Text attachments - making an NSTextAttachment unique?
      • From: Jérôme Laurens <email@hidden>
  • Prev by Date: Re: Getting User and Process Information
  • Next by Date: Multi line text input control with scrollable?
  • Previous by thread: Re: Text attachments - making an NSTextAttachment unique?
  • Next by thread: Re: Text attachments - making an NSTextAttachment unique?
  • Index(es):
    • Date
    • Thread