Drag&Drop woes...
Drag&Drop woes...
- Subject: Drag&Drop woes...
- From: <email@hidden>
- Date: Wed, 16 Mar 2005 8:01:50 +0000
Okay, this is seriously starting to get frustrating. I have a window with an NSTabView on it with 4 tabs. 3 of these tabs each have an NSTextView in them among other controls. All I want to be able to do is enable the user to drag files over the app (while it's running), and have it add the filenames to the NSTextView (as well as set the file(s) to an instance variable in the associated controller object for that tab).
Now, I have set my application up so files can be dropped onto the app icon (in the Finder or Dock) and have it set the file(s) to the appropriate instance variable of the appropriate controller object which also selects the appropriate tab and writes the filenames to the NSTextView. This is all working fine and dandy. I simply have an AppController set as NSApplication's delegate to use the openFiles: method, and this all works fine.
But I cannot enable drag and drop while the application is running. I tried subclassing NSTextView and added the appropriate code according to several working examples I've found on the web. Nothing. I tried using the actual window itself to accept drag and drop, nothing. Thinking that the NSTabView is the view item in the forefront, I subclassed the NSTabView, added the appropriate code, and nothing. I drag files over the application while it's open and running, and the files just slide back to the Finder window (or the Desktop if that's where I'm dragging the files from).
Am I missing something? Is there something else I should be subclassing and setting up to accept the dropping of files? This is the last major addition to my small app, and I'm really wanting to get it done so I can move on to other things. Thanks for any advice.
Yes, in each attempt I've called the registerForDragTypes: method in both the init and awakeFromNib method (as I'd seen it called in both places in different apps), and nothing.
_______________________________________________
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