• 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
Custom NSTextAttachment
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Custom NSTextAttachment


  • Subject: Custom NSTextAttachment
  • From: Alexander Reichstadt <email@hidden>
  • Date: Fri, 13 Jul 2012 23:14:35 +0200

Hi,

trying to build a custom subclass of NSTextAttachment I thought it would be fully supported in an NSTextView.

In a test project at app launch I insert an attachment:

    [_textView setString:@"This is a test string\rThis is a test string\rThis is a test string\rThis is a test string\rThis is a test string\rThis is a test string\rThis is a test string\rThis is a test string\rThis is a test string\rThis is a test string\r"];
    TATextAttachment *att = [[TATextAttachment alloc] init];
    NSAttributedString *as = [NSAttributedString attributedStringWithAttachment:att];
    [[_textView textStorage] appendAttributedString:as];

In the attachment I draw a custom cell. It all works so far, but when I select a text that contains that custom attachment and drag the selection to another location, only the text without the custom attachment cell icon is inserted at the new location.

When dragging a text that contains a regular NSTextAttachment it gets dragged and dropped as a file icon in the new location.

Why?

Alex
_______________________________________________

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

  • Prev by Date: Core Data Multiuser
  • Next by Date: -[NSFileHandle readInBackgroundAndNotify] opens the file again
  • Previous by thread: Re: Core Data Multiuser
  • Next by thread: -[NSFileHandle readInBackgroundAndNotify] opens the file again
  • Index(es):
    • Date
    • Thread