write to xml file using objective c

Posted by Mith on Stack Overflow See other posts from Stack Overflow or by Mith
Published on 2011-01-05T06:16:03Z Indexed on 2011/01/05 15:53 UTC
Read the original article Hit count: 170

Filed under:
|

Hi,

ok, I managed to read from xml file using NSXMLParser but now i don't know how to write to xml file. I have a xml file , say

<?xml version="1.0" encoding="UTF-8"?>
<root>
<user id="abcd" password="pass1"/>
<user id="efg" password="pass2"/>
</root>

Now when a new user enters details, I want to store them in a new tag.. lets say like, the id is "hhhh" and password is"pass3"

I want to add a new tag with attributes as such

<user id="hhhh" password="pass3"/>

to the xml file.

How should I do this. Please explain in an elaborate way . I am a newbie here. Any links to tutorials or examples will be much helpful.

Thanks

© Stack Overflow or respective owner

Related posts about objective-c

Related posts about cocoa