开发者

Parsing XML, details and attributes, iphone

开发者 https://www.devze.com 2022-12-16 03:46 出处:网络
I\'m not sure about parsing an xml with attributes.have seen a similar question here But it shows to get an attribute of 开发者_如何学JAVAintValue. But i need to get the attributes of string type,How

I'm not sure about parsing an xml with attributes. have seen a similar question here But it shows to get an attribute of 开发者_如何学JAVAintValue. But i need to get the attributes of string type,How to do that?? Images of xml and the relevant portions are given in the following links

Click here for xml and here for required data


This answer to the linked question should work for you as well. The contents of attributeDict are already NStrings. All that is going on extra in the linked answer that they are calling the intValue method on the returned NSString to parse that string into an int. In your case, you don't need this little bit of an extra step. If you just do this:

NSString * stringValue = [attributeDict objectForKey:@"attribute"];

you'll have the value of the attribute called "attribute" in a string.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号