iphone - 将 RestKit 与基于文件的 URL 结合使用

标签 iphone objective-c ios json restkit

我想将 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/

相关文章:

ios - 裁剪后无法绘制阴影

ios - 如何使用 AVCaptureDeviceDiscoverySession 获取前置摄像头、后置摄像头和音频

html - 背景图像在 iPhone 上显示不正确(居中)

ios - UIScrollview 'skips' 页面延迟加载

ios - 修改 iPhone 相机/手电筒?

ios - 由于 iOS 13.3.1 崩溃,Apple 拒绝了该应用程序

ios - 快速使用未实现的初始化程序 'init()'

iphone - 如何让 UISearchBar 范围栏始终可见?

objective-c - 如何获取没有导航栏的 UIView 的高度?

objective-c - Xcode:如何从 cocoa 项目创建.app?