NSBrowser fills NSPasteboard but won't drop
NSBrowser fills NSPasteboard but won't drop
- Subject: NSBrowser fills NSPasteboard but won't drop
- From: "Mr. Andrei Alandru Freeman" <email@hidden>
- Date: Fri, 17 Aug 2012 11:52:44 -0400
I have an NSBroswer with a series of entries that look up a text blob. If the blob exists then:
- (BOOL)browser:canDragRowsWithIndexes:inColumn:withEvent: returns YES.
This invokes - (BOOL)browser:writeRowsWithIndexes:inColumn:toPasteboard:
In here I do the following:
NSUInteger changeCount;
BOOL retBOOL = YES;
changeCount = [pasteboard clearContents];
changeCount = [pasteboard declareTypes:@[NSPasteboardTypeString, NSPasteboardTypeHTML]
owner:self];
didSet = [pasteboard setString:self.currentHTMLCode
forType:NSPasteboardTypeString];
retBOOL = retBOOL & didSet;
didSet = [pasteboard setString:[NSString stringWithFormat:@"<pre>%@</pre>", self.currentHTMLCode]
forType:NSPasteboardTypeHTML];
retBOOL = retBOOL & didSet;
Now the data analysis of the pasteboard coming out (with retBOOL: Yes) is:
pasteboard: : <NSPasteboard: 0x101931870>
name: : Apple CFPasteboard drag
change count: : 77
types: : (
"public.utf8-plain-text",
NSStringPboardType,
"public.html",
"Apple HTML pasteboard type"
)
items: : (
"<NSPasteboardItem: 0x1005a5cb0>"
)
PBItem: : <NSPasteboardItem: 0x1005a5cb0>
PBType: : public.utf8-plain-text
String for type [public.utf8-plain-text] = 89958 characters
PBType: : public.html
String for type [public.html] = 89969 characters
retValue: YES
So my problem is that when I drag this to SimpleText or BBEdit, nothing drops. I don't see a highlight of the target document. (Note: I also have a drag image routine, and I see the drag image)
Any ideas why I seem to be populating the pasteboard but it refuses to drop in the other app?
Thanks,
-Andrei
_______________________________________________
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