Drag 'n Drop a filename in a table

  • Hi. i'm trying to understand the drag and drop method and Cocoa. I'm
    reading many code but i need an help. I want to drop some filename in
    a table (and for now it works) but i don't want to drop the directory.
    Have you any tips or suggest to do this task? Must i use the
    "misterious" - validateDrop method? but how? it's easy make a control
    for check the FileType, but where i have to put this?

    I hope my english is readable..

    Thanks

    S.
  • On Dec 14, 2007, at 2:09 PM, Simone Tessaro wrote:

    > Hi. i'm trying to understand the drag and drop method and Cocoa. I'm
    > reading many code but i need an help. I want to drop some filename in
    > a table (and for now it works) but i don't want to drop the directory.
    > Have you any tips or suggest to do this task? Must i use the
    > "misterious" - validateDrop method? but how?

    Yes. In that method, get the file path, then use -[NSFileManager
    fileExistsAtPath:isDirectory:] to figure out if it's a file or folder.

    Nick Zitzmann
    <http://www.chronosnet.com/>
previous month december 2007 next month
MTWTFSS
          1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
31            
Go to today