XCode - Cocoa: Simple Drag&Drop into Window returning file path
===

I want to create a simple drag&drop app in xcode.
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.

AppDelegate.m :



    #import "AppDelegate.h"
    
    @implementation AppDelegate
    
    @synthesize window = _window;
    
    - (void)applicationDidFinishLaunching:(NSNotification *)aNotification
    {
          [_window registerForDraggedTypes:[NSArray arrayWithObjects:NSFilenamesPboardType, nil]]; 
    }
    
    -(NSDragOperation)draggingEntered:(id < NSDraggingInfo >)sender
    {
        return NSDragOperationGeneric;
    }
    -(BOOL)prepareForDragOperation:(id < NSDraggingInfo >)sender
    {
        NSPasteboard* pbrd = [sender draggingPasteboard];
        NSArray *draggedFilePaths = [pbrd propertyListForType:NSFilenamesPboardType];
        // Do something here.
        return YES;
        
       NSLog(@"string2 is %@",draggedFilePaths);}
    
    @end


----------


AppDelegate.h:

    //
    //  AppDelegate.h
    //  testdrag
    //
    //  Created by admin on 18.07.12.
    //  Copyright (c) 2012 __MyCompanyName__. All rights reserved.
    //
    
    #import <Cocoa/Cocoa.h>
    
    @interface AppDelegate : NSObject <NSApplicationDelegate>
    
    
    @property (assign) IBOutlet NSWindow *window;
    
    @end