0

I have 2 NSMutableArray's. One is storing a string and the other is storing a set of NSMutableArray's. So the layout looks like this:

NSMutableArrayParent {
    NSMutableArrayChild {
        someString
    }
    NSMutableArrayChild {
        someString
    }
    NSMutableArrayChild {
        someString
    }
}

I wish to write this data into an XML file.

I've looked at this question but it does not specifically tell me HOW to write the XML file (in fact none of the questions here have).

I want the XML file to look something like this:

<parent name="someParentName">
      <child name="someChildName">  
             <data>someString</data>
      </child>        
</parent>
     

Now, like the answer in the linked question, I can append to a NSMutableString and get lines like this <data>someString</data> but how can I get the closing child and closing parent tag?

I went through this tutorial but it is using GDataXML over something native to Objective C.

Also, how can I actually write this XML to disk?

I'm using Objective C with a mac.

Thanks!

2

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.