开发者

Get HTTP directory listing in Objective-C

开发者 https://www.devze.com 2023-04-04 13:33 出处:网络
I am making a Mac application in Objective-C and I want to show a list of files from a directory on my webspace via HTTP (unless an alternative 开发者_运维问答method is recommended).

I am making a Mac application in Objective-C and I want to show a list of files from a directory on my webspace via HTTP (unless an alternative 开发者_运维问答method is recommended).

Then from this list the user can click a button and download the chosen file.

My question is, how would you recommend I approach this? I haven't delved into HTTP with Objective-C before, downloading or anything.


Take a look at the WebView component in the WebKit framework. If you're showing all files in your Web site directory then you can set directory enabling to true on it and then just fetch the page with WebView. If you need to filter the returned list then you can do so in the WebView delegate methods.

http://developer.apple.com/library/mac/#documentation/Cocoa/Reference/WebKit/Classes/WebView_Class/Reference/Reference.html

0

精彩评论

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