【发布时间】:2011-03-22 22:20:31
【问题描述】:
我目前有一个带有以下代码的 xml:
<Level>
<!--Loads the animals for the Level-->
<Animal>
<Texture>panda.png</Texture>
<PositionX>100</PositionX>
<PositionY>50</PositionY>
<Type>Panda</Type>
</Animal>
<Animal>
<Texture>tiger.png</Texture>
<PositionX>200</PositionX>
<PositionY>150</PositionY>
<Type>Tiger</Type>
</Animal>
<Animal>
<Texture>monkey.png</Texture>
<PositionX>300</PositionX>
<PositionY>250</PositionY>
<Type>Monkey</Type>
</Animal>
</Level>
我想要的是摆脱 positionX 和 positionY 并将其替换为 CGPoint 变量。 这将使我稍后将在包含多个位置的行中添加的其他项目更容易。
我在互联网上搜索过,但找不到任何 GDataXML 文档。
为了获取我的字符串和整数,我在 GDataXMLElement 上使用了 .stringValue 和 .intValue。
我的问题是,GDataXML 是否有可能从 xml 文件中获取 CGPoint 值,或者我是否必须像我目前拥有的那样将其作为单独的整数?
【问题讨论】:
标签: iphone objective-c xml gdata cgpoint