objective c - Drag-and-drop files onto an NSTableView? -


I have a NSTableView that I allow video files to drag and drop users Want to give When they leave the file, it will be added as a line in the table view.

How would I go about doing this? Currently TableView data is from an array controller (which takes its data from NSMUTABELRAR)

I have got a documentation, but it can not seem to work.

< P> I have made ...
  • "TableCon" class (which I have changed to get from Nstable Weave to NSFable Vimeu) has been created
  • NSTableView class Changed to TableCon
  • Set that class
  • to the NSTableView counter Call Outlet called registerForDraggedTypes in TableCon's init
  • implemented - draggingEntered: (ID of & lt; NSDraggingInfo & gt;) This (again In tablecon)
  • .. But, nothing, it seems like I did not change anything (no error), what am I doing wrong?

    Edit: I have tried to implement Boaz Stoller's suggestion, and also found the details of the solution (including the solution for the post), so now what I did

    • Subclass NSArrayController that feeds content in table view (TableListCon)
    • Add tableview outlet to TableListCon (and it's in the direction of NSTableView
    • Apply validateDrop, writeRowsWithIndexes, and acceptDrop in TableListCon
    • On the tableView Outlet is called registerForDraggedTypes.

    Once again, there are no errors / warnings, but only the awake framenb method is being called (no other method is called)

    NSTableView handles different drag-and-drop from generic views, which means it's a good thing overall. You do not need to manually handle complex highlighting, cell tracking and inserting the requirements of tables that

    details of what is required can be found. Basically, you still call -registerDraggedTypes: (generally in your -awakeFromNib method), but instead of applying NSDraggingDestination methods, you can be found in different data sources, associated with drag and drop, applied. You do not need NSTableView subclass to apply drag-and-drop in this fashion.

    Note that these are data source methods that you need to hook up the table view data to apply the source outlet to that category that those methods are called for them.


    Comments

    Popular posts from this blog

    python - Overriding the save method in Django ModelForm -

    html - CSS autoheight, but fit content to height of div -

    qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -