So I'm adding a iCloud synchronisation of the the data in the application I'm working on. Everything works splendidly including photos, but I run into problems when it comes to audiofiles and videofiles. I'm saving the audiofiles in the documents folder of the application, and the videos in the temp folder, and then save them both as NsManagedObject subclasses to keep track of the filename. When I reload the data from iCloud after removing the app and rebuilding it again I get
Librarian returned a serious error for starting downloads Error Domain=BRCloudDocsErrorDomain Code=5 "The operation couldn’t be completed. (BRCloudDocsErrorDomain error 5 - No document at URL)
So it seems like the files are not uploaded to iCloud.
I'm obviously missing something here, and I find the apple documentation confusing when it comes to this, could anyone point me to the right direction?
So it turns out it's not enough to save the file to the application directory to upload it to icloud, so the you need to keep the binary data for the file as part of the NSManagedObject subclass, then write it again to to the application directory when it's pulled from iCloud.
This might have seemed obvious to some but it wasn't for me so I'll leave this here.