Xml settings dont load!

Hi! im trying to load a xml file!
any ideas? im using iOS 8.4
i get this:

Where do you have your xml file? Is it included as a bundled resource?

Can you post your header file as well? Just curious what you’re using to load your XML with…

Is in the data folder

Can you try getting the xmlSettingsExample to build from the example folder? It works for me on iOS 8.0. See if that works first!

1 Like

yeah run, i tried first but two things happen:
1.Running the app the new values that suppose to save into the xml file doesn’t save it( using the orginal xml of the example).
2.When i make a new xml file doesn’t read the new file.

and now im trying to do it apart the example also i tried the osx version and works perfectly.

Hey! i using ofxml i can read the file but i can save it any idea?
im saving it like this


In OSX work s fine but when i do it in ios works fine only i cant save it.

Hi, I’m pretty sure you can only write to certain folders in iOS, this is the path I use to save settings in one of my iOS apps [1]:

ofxiOSGetDocumentsDirectory() + “/MainSettings.xml”;

[1] https://itunes.apple.com/gb/app/julia/id892409235?mt=8

Thanks! but still not working i have my xml file in the data folder.
Did you use ofXxmlSettings or ofxml


This was using an ofXml.

So as you say you are able to read a file when trying the xmlSettingsExample, but values are not saved when you run on iOS right?

On OSX this would work as there are no such sandbox restrictions.

You’ll be able to read an XML file from the data folder on iOS, but this is not writable, so what you could do is to check the ofxiOSGetDocumentsDirectory() for your XML file first and if it’s not there (as when the App is launched for the first time), load the defaults from the data folder.
Then when you want to save the file you’d save it to the ofxiOSGetDocumentsDirectory()

Yes im not using ofxxmlsetting im on ofxml.
Im available to read but cant write it.
Ok so where is the ofxiOSGetDocumentsDirectory() located?

It’s specific to the device and app, print it out and you’ll see a long random looking string.

I don’t know how you’d drop files into it from Xcode, or if it’s even possible, but if you follow what I outlined above you’ll be able to read defaults and write updated values.

Gotcha! is working!
Thanks a lot !