• 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
NSBrowser fills NSPasteboard but won't drop
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Prev by Date: Re: Displaying a sheet immediately after a window is opened
  • Next by Date: invoke java through AuthorizationExecuteWithPrivileges() then jvm comes up without ipv6 ?
  • Previous by thread: Re: initial value of an NSPopupButton shows with delay
  • Next by thread: invoke java through AuthorizationExecuteWithPrivileges() then jvm comes up without ipv6 ?
  • Index(es):
    • Date
    • Thread