为什么RestKit会使我的基本网址翻倍?

时间:2012-03-28 13:01:49

标签: restkit

我在使用RestKit时遇到了一些麻烦。

首先我尝试使用RKClient:

[RKClient clientWithBaseURL:[defaults stringForKey:@"myURL"]];

但是我遇到NSManagedObject+ActiveRecord.m引发的错误(类似于this)。所以我最终创建了一个RKObjectManager(虽然我不打算使用它):

RKObjectManager* manager = [RKObjectManager objectManagerWithBaseURL:[defaults stringForKey:@"orangeqcURL"]];
manager.objectStore = [RKManagedObjectStore objectStoreWithStoreFilename:@"OrangeQC.sqlite"];
[RKObjectManager setSharedManager:manager];

但是我无法接到基本的工作电话:

[RKClient sharedClient].username = self.login;
[RKClient sharedClient].password = self.password;
[[RKClient sharedClient] get:@"/users" delegate:self];

它给了我两个网址的网址错误:

Error Domain=NSURLErrorDomain Code=-1002 "unsupported URL" UserInfo=0x825f2e0 {NSErrorFailingURLStringKey=//mydomain.com/mydomain.com/users, NSErrorFailingURLKey=//mydomain.com/mydomain.com/users, NSLocalizedDescription=unsupported URL, NSUnderlyingError=0x8204230 "unsupported URL"}

知道为什么会加倍吗?

当我打印出基本网址时,它看起来是正确的:

NSLog(@"rkclient url: %@",[[RKClient sharedClient] baseURL]);
> rkclient url: mydomain.com/

任何帮助将不胜感激。谢谢。

0 个答案:

没有答案