Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我在正在运行的服务器上有一个受密码保护的目录。我想从这个目录(使用 URL)下载一些文件到我的 iPad 应用程序的 Documents 目录。如何发送我尝试访问的目录的密码?
使用NSURLConnection. 如果服务器要求输入密码,则会向连接的委托发送一条-connection:didReceiveAuthenticationChallenge:消息。使用它为服务器提供密码并继续下载。
NSURLConnection
-connection:didReceiveAuthenticationChallenge: