• 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
Drag drop - namesOfPromisedFilesDroppedAtDestination has an indexSet = nil
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Drag drop - namesOfPromisedFilesDroppedAtDestination has an indexSet = nil


  • Subject: Drag drop - namesOfPromisedFilesDroppedAtDestination has an indexSet = nil
  • From: "Simon Liu" <email@hidden>
  • Date: Thu, 27 Apr 2006 21:37:53 +0100

I am able to drag'n'drop from my custom NSTableView to the
Desktop/Finder when I do not implement -mouseDragged: and just
implement:

- (BOOL)tableView:(NSTableView *)tv writeRowsWithIndexes:(NSIndexSet
*)rowIndexes toPasteboard:(NSPasteboard*)pboard

- (NSArray *)tableView:(NSTableView *)tv
namesOfPromisedFilesDroppedAtDestination:(NSURL *)dropDestination
forDraggedRowsWithIndexes:(NSIndexSet *)indexSet

This works fine, however there is a situation in my application where
I need to track mouseDown: events, and I do need to implement
mouseDragged:.  So I make sure the drag pasteboard is setup correctly
for NSFilesPromisePboardType, and start the drag session myself with:

[self dragImage:dragImage at:dragPoint offset:NSZeroSize
event:theEvent pasteboard:pboard source:self slideBack:YES];

Everything seems to be okay, except that indexSet is nil when the
method below is invoked:

- (NSArray *)tableView:(NSTableView *)tv
namesOfPromisedFilesDroppedAtDestination:(NSURL *)dropDestination
forDraggedRowsWithIndexes:(NSIndexSet *)indexSet

Why is the indexSet nil, when I implement mouseDragged: and start a
drag manually?

I have worked around this by placing the rowIndexes onto the
pasteboard under my own type, but I would like to know if somebody
else has come across this issue.

Thanks.
Simon
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Drag drop - namesOfPromisedFilesDroppedAtDestination has an indexSet = nil
      • From: Nick Zitzmann <email@hidden>
  • Prev by Date: Re: call C application
  • Next by Date: Re: call C application
  • Previous by thread: Re: call C application
  • Next by thread: Re: Drag drop - namesOfPromisedFilesDroppedAtDestination has an indexSet = nil
  • Index(es):
    • Date
    • Thread