• 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: Martin Wierschin <email@hidden>
  • Date: Thu, 27 Oct 2005 17:47:34 -0700

Hi Keith,

The problems I have seem to lie with the way that the text system
deals with attributes. The text system assumes that
text attributes don't change, and so may "merge" two
different attribute objects into the same objects

Are you taking about how characters with equal attribute dictionaries applied are merged together into a single attribute run (eg: effective range spans both characters)? I'm not sure that rule applies to attachment characters, but if it does, you could just create a subclass of NSTextAttachment that overrides isEqual to do the right thing for your attachments.


For instance, I may create a
text attachment cell that gets highlighted when the
cursor is next to it. However, if I create two such
attachments next to each other and move the cursor
next to one of them, both will get highlighted

You had to write some code to achieve that selection behavior, correct? If so, in that code I would ensure that you only create a selection that spans one attachment character at a time.


~Martin

_______________________________________________
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


References: 
 >Text attachments - making an NSTextAttachment unique? (From: Keith Blount <email@hidden>)

  • Prev by Date: NSRulerView's style pulldown.
  • Next by Date: Re: List of AppKit NSSound names
  • Previous by thread: Text attachments - making an NSTextAttachment unique?
  • Next by thread: Re: Text attachments - making an NSTextAttachment unique?
  • Index(es):
    • Date
    • Thread