Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在我的 iOS 应用程序上,我试图找出 XML 数据中是否存在节点。我正在尝试使用
+ (GDataXMLElement *)elementWithName:(NSString *)name 如果节点不存在但它似乎不起作用,预计它将返回 nil。
+ (GDataXMLElement *)elementWithName:(NSString *)name
一种选择是将 XML 字符串转换为字典并搜索键。但是有没有办法跳过字典转换。
谢谢!
终于通过使用它来工作了
GDataXMLElement *abc = (GDataXMLElement *)parentNode; NSArray *tempArray = [abc elementsForName:childNode ]; return [tempArray count];
如果还有其他方法可以做到这一点,请告诉我。