I have an ios game mostly written in C++ which stores its game data in the standard c++ binary format. I would like to add iCloud support but I’m not sure if i can upload this kind of files to iCloud.
Is it possible? If so, how?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
iCloud documents of your app or game can have any internal format you want – you don’t have to use the NSDocument class.
Note that iCloud backups are not the same as iCloud Documents. Putting user data into the Documents folder will cause it to be backed up to iCloud as part of the device backup but will NOT cause it to be synced to other devices. For that you need to use the iCloud APIs to correctly coordinate the syncing process.
You can either save non-specific data that will be treated as a single item or “Documents” that users can delete one by one, when, for example, they are running out of space. You can see how this works by clicking “Manage” in the iCloud preferences.
If the data you need to store is not too big (a few kilobytes) I would suggest looking at the key-value store as well, which is MUCH simpler than the documents API. It is possible to store binary data there using NSData. The limit for the key-value storage has been recently raised to 1MB and 1024 keys.