开发者

Populate table view with filenames

Is there a way to populate the data in a table view with the filenames from a certain folder? T开发者_如何学JAVAhanks.


NSFileManager's documentation has a section under Tasks called 'Discovering Directory Contents'. Use these methods to get the contents of a directory and then populate your data source for the table view with the results.

You can use that data to display the directory contents in the table view.


This is the code I used (for anyone that may need it):

NSString *bundleRoot = [[NSBundle mainBundle] bundlePath];
NSArray *dirContents = [[NSFileManager defaultManager] directoryContentsAtPath:bundleRoot];
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜