Preset saving strategy for iOS?


#1

Hello folks

Has anyone got any idea of a good strategy for saving presets on iOS via Juce? 

I have a simple instrument with a parameter list that I need to be able to save out and recall somehow. On OSX I've got something prototyped where I'm just spitting out XML files, which works great for desktop. But I'm scratching my head over what to do on iOS, so wondering how others have tackled this problem. I admit I don't understand much yet about how this part of iOS works, or whether I can save out files at all, so any tips or "Google this" suggestions are helpful :D

Thanks!

Nick


#2

Just to clarify, what I'm running into is if I try to save a .xml file out to the Documents folder on iOS, it looks like nothing happens -- there's no file saved as far as I can see. Do I need to do anything else such as registering the document type the app supports? I saw something about this in the SDK docs but I understood this was only to do with file handling between apps. Anyway, maybe I'm getting warmer. Any suggestions appreciated. -n


#3

The documents folder should be just fine, you should be able to store anything you want. It's just that only your app can see what's in there (sandboxing), but that doesn't matter for your goal. Hmm.. could you post the code you are using for saving/reading the file? Must be something not quite right there...


#4

Ok, i figured out what's going wrong. Basically what happens on OSX is the native file chooser is automatically appending the ".xml" to the end of my preset file name when I save. On iOS, it looks like I'm getting the Juce file chooser (I assume because there is no iOS file chooser) and it is not automatically adding the file extension. If I manually add ".xml" when I'm saving the file, it works! So I'm able to save into and read from the documents folder as you suggest, its just the file chooser stuff that was tripping me up.

thanks -n