This is part of the code I'm working on. This method can be found when creating a new project.
-(void)applicationDidFinishLaunching:(NSNotification*)aNotification
{
[window registerForDraggedTypes:[NSArray arrayWithObjects:NSFilenamesPboardType, nil]];
}
I'm new too. Anyway, it worked for me.
And then it is important. We must connect this object to the window object to handle forwarding messages in this object
MainMenu.xib Interface Builder.
Interface Builder "App Delegate" ( ) "" "".
( Inspector)
"App Delegate" "Window".
:
-(NSDragOperation)draggingEntered:(id < NSDraggingInfo >)sender
{
return NSDragOperationGeneric;
}
-(BOOL)prepareForDragOperation:(id < NSDraggingInfo >)sender
{
NSPasteboard* pbrd = [sender draggingPasteboard];
return YES;
}