- Home /
ipone issue in saving the game progress in xml files
im trying to save the variables of level in xml file ,using cs scripts 1->>so that if the player exits from the game , if he logs in again , it tries to load the recent level
2->>and activates the menu icons in choose levels Menu based on the variable in xml file
but it looks iphone is not allowing to access the files i'm using the filestrams and system.xml the code follows as below.
FileStream fs= new FileStream("/newxml.xml",FileMode.Open,FileAccess.ReadWrite,FileShare.ReadWrite);
XmlDocument xmldoc = new XmlDocument();
xmldoc.Load(fs);
XmlNodeList xmlnode = xmldoc.GetElementsByTagName("game");
xmlnode[0].ChildNodes.Item(1).InnerText = "1";
print(xmlnode[0].ChildNodes.Item(1).InnerText);
FileStream fs2 = new FileStream(Application.dataPath+"/newxml.xml" ,FileMode.Truncate,FileAccess.ReadWrite, FileShare.ReadWrite); xmldoc.Save(fs2); fs2.Close(); fs.Close();
also please tell me if i could save to iphone's local documents , like ones in user folder in windows systems.
Answer by Xenland · May 12, 2011 at 03:40 PM
Just for reference for anybody that comes across this page, I don't believe iPhone natively supports using XmlDocument or better known as System.XML namespace. You must include what ever XML.dll files that are required which is beyond the scope of my knowledge.
Your answer
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
Distribute terrain in zones 3 Answers
How do I make this XML file parser work in Unity 1 Answer
IsolatedStorageException: Could not find a part of the path 0 Answers
xml parsing error 0 Answers