title: NSPasteBoard get file from the Download (Grid View) in dock via DragAndDrop to App Statusbar Icon
body: <p>I Implemented drag and drop functionality in a cocoa app that I am working on.
  When I drag and drop files, from a folder or from the desktop or from any specific location on the hard drive, onto the status bar icon of my app, the app appropriately detects it and I am able to work with the file without any issues at all. </p>
  
  <p>The problem that I encounter is that if I click the Downloads icon in the dock (it opens in grid view) and from there I select a file and drag and drop it to the status bar, then the app does not detect it at all. The "performDragOperation" is not even called in this scenario. I think this is because the Downloads Grid is not a specific location, instead it is a representation of the Downloads folder presented on the desktop.</p>
  
  <p>This is where I register for the Drag types: </p>
  
  <pre><code>- (id)initWithStatusItem:(NSStatusItem *)statusItem {
  CGFloat itemWidth = [statusItem length];
  CGFloat itemHeight = [[NSStatusBar systemStatusBar] thickness];
  NSRect itemRect = NSMakeRect(0.0, 0.0, itemWidth, itemHeight);
  self = [super initWithFrame:itemRect];
  
  if (self != nil) {
      _statusItem = statusItem;
      _statusItem.view = self;
  }
  
  NSArray *dragTypes = [NSArray arrayWithObjects:NSFilenamesPboardType, NSURLPboardType, nil];
  [self registerForDraggedTypes:dragTypes];
  
  return self; 
  </code></pre>
  
  <p>}</p>
  
  <p>Here is the draggingEntered method:</p>
  
  <pre><code>- (NSDragOperation)draggingEntered:(id&lt;NSDraggingInfo&gt;)sender {
  ApplicationDelegate *appdelegate = (ApplicationDelegate *)[[NSApplication sharedApplication] delegate];
  
  if (!appdelegate.isApplicationLoggedIn) {
      return NSDragOperationNone;
  }
  
  if ([sender draggingSourceOperationMask] &amp; NSDragOperationCopy) {
      return NSDragOperationCopy;
  }
  
  if ([[sender draggingPasteboard] availableTypeFromArray:[NSArray arrayWithObjects:NSFilenamesPboardType, NSURLPboardType, nil]]) {
      return NSDragOperationCopy;
  }
  
  return NSDragOperationNone;
  </code></pre>
  
  <p>}</p>
  
  <p>Any help would be appreciated. 
  Thank You.</p>