Custom NSTextAttachment

  • 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
previous month july 2012 next month
MTWTFSS
            1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31          
Go to today