【发布时间】:2012-10-26 23:35:52
【问题描述】:
我正在尝试解析我从对象 c 中的 http get 请求获得的响应,我已经这样做了:
NSString *returnValue = [[NSString alloc] initWithData:oRespondeData encoding:NSUTF8StringEncoding];
SBJsonParser *jParser = [[SBJsonParser alloc] init];
NSDictionary *JSONresponse = [jParser objectWithString:returnValue];
然后我搜索一个特定的键:
NSArray *jSon1 = [JSONresponse objectForKey:@"links"];
并且在数组中只有一个元素,如果我记录它,我有这个:
NSLog(@"%@",[jSon1 objectAtIndex:0]);
日志:
(
"Video.720p.X264-..",
"",
"http://video/dl/Video.720p.X264-.."
)
如何使用 http 获取 url?我已经尝试了一切,我也尝试修剪字符串以删除空格,但似乎它不是 nsstring,因为我收到了
[__NSArrayM stringByTrimmingCharactersInSet:]: unrecognized selector sent to instance
我该怎么办?
【问题讨论】:
-
您支持哪些版本的 iOS?
-
我是在 Mac OS X 上做的,不是 iphone...
标签: objective-c json cocoa http nsstring