void XmlParse :: setXmlMove (CCString name, Article * arti)
{
tinyxml2 :: XMLDocument myDocument;
myDocument.LoadFile (name.getCString ());
XMLElement * root = myDocument.RootElement ();
XMLElement * FirstPerson = root-> FirstChildElement ("cllectList");
while (FirstPerson)
{
CCString tempString = FirstPerson-> Attribute ("articleID");
int intID = tempString.intValue ();
if (intID == arti-> _articleID)
{
break;
}
FirstPerson = FirstPerson-> NextSiblingElement ();
}
FirstPerson-> SetAttribute ("locationX", arti-> getPositionX ());
FirstPerson-> SetAttribute ("locationY", arti-> getPositionY ());
myDocument.SaveFile (name.getCString ());
}
The above code is the C + + code in VS2010 run through the middle, can be saved in XCODE run through the middle, there is no error, but does not change the contents of the xml file is not a permissions problem?
Reply:
DMT231000534
No comments:
Post a Comment