title: Simple Drag and Drop into Window returning file path
body: <p>I want to implement simple drag and drop in my application.
  If you drag a file into window I want to return
  the file-path with NSLog. Here is my code but 
  nothing happens if I drag a file. By the way I
  connected AppDelegate with referencing outlets
  with window (delegate) to receive everything from window.</p>
  
  <p>AppDelegate.m :</p>
  
  <pre><code>#import "AppDelegate.h"
  
  @implementation AppDelegate
  
  @synthesize window = _window;
  
  - (void)applicationDidFinishLaunching:(NSNotification *)aNotification
  {
        [_window registerForDraggedTypes:[NSArray arrayWithObjects:NSFilenamesPboardType, nil]]; 
  }
  
  -(NSDragOperation)draggingEntered:(id &lt; NSDraggingInfo &gt;)sender
  {
      return NSDragOperationGeneric;
  }
  -(BOOL)prepareForDragOperation:(id &lt; NSDraggingInfo &gt;)sender
  {
      NSPasteboard* pbrd = [sender draggingPasteboard];
      NSArray *draggedFilePaths = [pbrd propertyListForType:NSFilenamesPboardType];
      // Do something here.
      return YES;
  
     NSLog(@"string2 is %@",draggedFilePaths);}
  
  @end
  </code></pre>
  
  <hr>
  
  <p>AppDelegate.h:</p>
  
  <pre><code>//
  //  AppDelegate.h
  //  testdrag
  //
  //  Created by admin on 18.07.12.
  //  Copyright (c) 2012 __MyCompanyName__. All rights reserved.
  //
  
  #import &lt;Cocoa/Cocoa.h&gt;
  
  @interface AppDelegate : NSObject &lt;NSApplicationDelegate&gt;
  
  
  @property (assign) IBOutlet NSWindow *window;
  
  @end
  </code></pre>