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
I want to display files’ data in a tableview . Files are stored in
Share
Once you get the content of the directory, call
NSFileManger‘sattributesOfItemAtPath:error:method on the path of each file. The method returns anNSDictionaryof 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 useNSWorkspace‘siconForFile:method.