You must write to the correct directories on iOS. The key is, is what you're writing user generated, or just an offline cache? If the latter, you must not store in iCloud as iOS would like to delete...