I tried to upload a picture to CloudKit
, and store it as NSData
, but with a relatively bigger picture, taken with camera, I get this error:
Error saving record <CKRecordID: 0x15998770; 04359DFA-8370-4000-9F53-5694FC53FA9C:(_defaultZone:__defaultOwner__)> to server: record too large id=04359DFA-8370-4000-9F53-5694FC53FA9C of type UserSetting
What is the maximum size of data is able to store in CloudKit
?
How do you store big images taken with camera in CloudKit
?
I tried with two image, and I plotting out size of them.
let d = UIImagePNGRepresentation(image)
println("d.length: \(d.length)")
d.length: 55482
<- worksd.length: 17614327
<- does not work
You should store pictures as a CKAsset. For a CKRecord there is a size limitation. For a CKAsset there is not (beside the CloudKit storage limitations). According to the documentation:
You can create a CKAsset like this: