Ios 针对通道';s视频列表

Ios 针对通道';s视频列表,ios,afnetworking,afnetworking-2,afhttprequestoperation,nsurlerrordomain,Ios,Afnetworking,Afnetworking 2,Afhttprequestoperation,Nsurlerrordomain,这可能是我忽略的一些简单的事情。我正在尝试使用AFNetworking从uStream的API生成一个AFHTTPRequest。我应该得到一个JSON负载响应,列出uStream频道上的所有视频。这是我的密码: NSURL *url = [NSURL URLWithString:@"https://api.ustream.tv/channels/12321320/videos.json"]; NSURLRequest *request = [NSURLRequest requestWithUR

这可能是我忽略的一些简单的事情。我正在尝试使用AFNetworking从uStream的API生成一个AFHTTPRequest。我应该得到一个JSON负载响应,列出uStream频道上的所有视频。这是我的密码:

NSURL *url = [NSURL URLWithString:@"https://api.ustream.tv/channels/12321320/videos.json"];
NSURLRequest *request = [NSURLRequest requestWithURL:url];

AFHTTPRequestOperation *operation = [[AFHTTPRequestOperation alloc] initWithRequest:request];
operation.responseSerializer = [AFJSONResponseSerializer serializer];

[operation setCompletionBlockWithSuccess:^(AFHTTPRequestOperation *operation, id responseObject) {
    NSLog(@"success");

} failure:^(AFHTTPRequestOperation *operation, NSError *error) {
    NSLog(@"failed");
}];

[operation start];

在浏览器中进行测试时,一切正常,但在尝试使用AFNetworking时,我遇到了NSURLErrorDomain故障。有人有什么建议吗?

我的代码很好,但我的iphone模拟器有问题。重置内容和设置就成功了。感谢k6sandeep的帮助。

我复制并粘贴了您的代码,我的代码运行良好。您得到了什么响应?我得到了相同的json响应。我正在使用模拟器。由于某些原因,它不能与模拟器一起工作。愚蠢的错误。谢谢不久前,我在模拟器中使用Charlie作为HTTP代理。它肯定对我在模拟器上的安全证书做了些什么。