Custom NSTextAttachment
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