【发布时间】:2012-07-17 02:19:44
【问题描述】:
我正在尝试解析 YouTube 数据 API 提供的 YouTube 供稿。此提要列出了所有视频uploaded by a specific user,例如:https://gdata.youtube.com/feeds/api/users/google/uploads?v=2
我在我的 iOS 应用程序中使用 touchXML。我尝试使用 CXMLDocument 中的 nodesForXPath 函数收集所有 <entry> 节点。
NSURL *url = [NSURL URLWithString: newsFeedUrl];
CXMLDocument *feedParser = [[CXMLDocument alloc] initWithContentsOfURL:url options:0 error:nil];
NSArray *resultNodes = [feedParser nodesForXPath:@"//entry" error:nil];
NSLog(@"%@",resultNodes.count); // >>> return (null)
但是这个查询没有返回任何东西。我检查了 xpath 语法;我觉得没有错。
【问题讨论】:
标签: objective-c ios xml xpath touchxml