RestKit 不发送第二个请求我有一个简单的应用程序,有 1 个视图和 2 个按钮,当我第一次单击任何按钮时,按钮的标题是主机名(yandex.ru 和 localhost:3000),但如果我第二次单击任何它不发送它....我做错了什么?
下面是我的 ViewController 代码的一部分
- (IBAction)testRestkit:(UIButton *)sender
{
RKClient *client =[RKClient clientWithBaseURLString:[NSString stringWithFormat:@"http://%@",sender.titleLabel.text]];
client.cachePolicy = RKRequestCachePolicyNone;
[client get:nil delegate:self];
}
- (void)requestWillPrepareForSend:(RKRequest *)request
{
NSLog(@"Preparing for request......");
}
- (void)request:(RKRequest *)request didFailLoadWithError:(NSError *)error
{
NSLog(@"%@",[error localizedDescription]);
}
- (void)request:(RKRequest *)request didLoadResponse:(RKResponse *)response
{
if ([response isHTML]) {
NSLog(@"Loaded html!");
} else{
NSLog(@"Loaded some response!");
}
}