我想将 RestKit 与基于文件的 URL 结合使用:
file://localhost/Users/me/somefile.json
但是,当我使用 RestKit 启动请求时,RestKit 无法创建相应的 RKURL
对象,尽管原始对象是有效的 NSURL
对象 (completeURL
为零):
NSURL *completeURL = [NSURL URLWithString:completePathWithQuery relativeToURL:theBaseURL];
if (!completeURL) {
RKLogError(@"Failed to build RKURL by appending resourcePath and query parameters '%@' to baseURL '%@'", theResourcePath, theBaseURL);
[self release];
return nil;
}
RestKit 通常支持基于文件的 url 吗?
更新:我发布了 an issue在 RestKit
最佳答案
我只是引用问题所有者更新中的答案link所以人们可能会发现它更容易。
I found the problem I was having. It looks like I can't use
@"file://localhost/Users/me/Folder"
as baseURL, but rather@"file://localhost
.
关于iphone - 将 RestKit 与基于文件的 URL 结合使用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12567321/