|Nov 16, 2008, 10:07 PM||#1|
How to drop a file anywhere on the window
Hi. I am fairly new to Cocoa programming and I have a problem that I have not been able to figure out. I have a simple little Cocoa app consisting of a TableView and a multiline TextField and I want to be able to drop a file anywhere on the app. I have made an app that would accept drop on a textfield, but now I want to be able to drop it anywhere on the window.
First I tried selecting the main view in Interface Builder and changing the class to DroppableView (a class I made subclassed from NSView to implement the drag/drop handlers) but initWithFrame would never fire when I run the program.
Then I returned the class to NSView and covered it with a CustomView control and set its class to DroppableView. This would fire the initWithFrame controls, but the TableView and TextField that I had on top of the control were no longer visible.
This shouldn't be that complicated of a thing to do, but I am out of ideas. Any help?
|Nov 17, 2008, 06:29 PM||#3|
Thanks a ton! I have been looking for that for a while!
UPDATE: Now the view catches the events but the TableView and TextField I have on it are not visible at runtime. Do I have to programmatically add them since I overrode the view?
ANOTHER UPDATE: never mind - I wasn't calling super's init - now it works
Last edited by sirjorj; Nov 17, 2008 at 08:42 PM.
|Thread Tools||Search this Thread|
|thread||Thread Starter||Forum||Replies||Last Post|
|How to make PDF files created on PC read properly on a MAC||kelhami||Mac OS X||12||Aug 12, 2011 03:29 PM|
|How to open a file dialog before the Main window display?||MayPeng||Mac Programming||3||Dec 9, 2010 09:31 PM|
|Tip: How to copy/move files with only one window||n8mac||Mac OS X||2||Jan 6, 2009 06:43 PM|
|How to Download IPA Files And Preserve the File Extension||kevhui||Mac Basics and Help||3||Dec 22, 2008 11:46 PM|
All times are GMT -5. The time now is 11:52 PM.