-1

I want to display files' data in a tableview . Files are stored in a directory. I want to display in the tableview : the icon , name , size and the date of the files. Thanks to NSFileManger , I found how to display directory's content ,but I can't display the properties as I want. Do you have any suggestion of how does it work , idea , tutorial? thanks

Wael
  • 73
  • 5

1 Answers1

0

Once you get the content of the directory, call NSFileManger's attributesOfItemAtPath:error: method on the path of each file. The method returns an NSDictionary of file attributes of each particular file. Grab the attributes that you want using their keys - NSFileType, NSFileSize, NSFileModificationDate, and so on; all keys are listed in the documentation. This will give you everything except the icon, for which you need to use NSWorkspace's iconForFile: method.

Sergey Kalinichenko
  • 675,664
  • 71
  • 998
  • 1,399