Hi everyone, I've recently ported a MIDI music app from PC to iOS with a good deal of success so far. I need to maintain compatibility between data files, for example, imagine I have an XML file which I use on iOS and PC which describes a piece of music. I want this file to be installed with the app when it runs. I also want to save changes to this file on the local device when the app exits.
An easy way to imagine this scenario is think of user settings being stored in an XML file. I don't want the file to start life blank, so I provide a default set of settings to the app for when it starts. Then when the app exits, it needs to update these settings for next time.
I've set the BuildAction on my file to BundleResource, and also set the Copy to Output Folder, both which seem to be required to get the file into the right place, (I want to store all this stuff in a sub directory called DataFiles).
So all is well on the Emulator, my settings are loaded and saved. However, on the actual iOS device, the file loads OK, but I can't write to it, I get an UnauthorizedAccessException when I try to write back to the file.
I have all sorts of theories as to what's going on, but no idea how to fix it For example, is it because I've selected to have these files copied in to place as BundleResources,and as such they're not expected to be modifiable?
Any thoughts and sample code / patterns would be really appreciated, as I'm very stuck!