开发者

parsing integer value

开发者 https://www.devze.com 2023-04-04 18:19 出处:网络
I have an xml document with the structure like this <id>some number like 456<\\id> <name开发者_如何转开发>some name like string<\\name>

I have an xml document with the structure like this

<id>some number like 456<\id>
<name开发者_如何转开发>some name like string<\name>

So I parse the document with NSXMLParser and put the result in to an array ogf objects with the structure like the xml entity.

But when I try to parse the id like a NSInteger it can not do this I parsing it like NSNumber.

After the parsing is finished and I have the contents of my xml doc in to an array I print the array values and the number the id entry has a totally different values than this in to the xml doc.

Why is happening like this I do not know? Any help will be useful.


is that what the xml looks like? beacuse the <\id> should be

Second option how are you parsing the id value should be something like

[Array addObject:[NSNumber numberWithInt:[string intvalue]]];

That said i need to see the code and output to properly answer

0

精彩评论

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