【发布时间】:2011-07-10 23:54:24
【问题描述】:
我可以通过 NSURL 访问我的本地文件:
NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"file://localhost/Users/user/Desktop/lucky_numbers.json"]];
但我需要访问另一台 PC 的文件。 我试过了:
NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"file://foyzulkarim:000000@192.168.1.48/localhost/Users/foyzulkarim/Desktop/lucky_numbers.json"]];
和
NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"file://192.168.1.48/localhost/Users/foyzulkarim/Desktop/lucky_numbers.json"]];
和
NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"file://Foyzul-Karims-MacBook.local/localhost/Users/foyzulkarim/Desktop/lucky_numbers.json"]];
但错误显示NSURLError domain code -1100
如果有人知道怎么做,请帮助我。
【问题讨论】:
标签: iphone objective-c xcode nsurl nsurlrequest