使用云工具包将图像上传到 icloud 会引发错误 ios
Uploading image to icloud using cloud kit throws error ios
我遇到了一个问题。使用云工具包将图像上传到 icloud
时抛出错误。它抛出以下错误:
(< CKError 0x7ffad06b6780: "Internal Error" (1/5000); "Couldn't create a PCS identity">)
当图片没有和其他数据一起上传时,其他数据上传成功。
这里我提供了我用来设置上传图片的代码。
var noteRecord: CKRecord!
if let url = imageURL {
let imageAsset = CKAsset(fileURL: url)
print("imageAsset \(imageAsset)")
noteRecord.setObject(imageAsset, forKey: "noteImage")
}
这是一个特定于用户的问题,在用户在其其中一台设备上启用 iCloud Drive 后,iCloud Keychain 和 iCloud Drive 文件夹会出现此问题。
示例日志:
Oct 17 00:38:17 hostname.local com.apple.iCloudHelper[1284] :
PCSIdentityCollectionSetup: {type = mutable dict, count = 3, entries
=> 0 : {contents = "kPCSSetupUsername"} = {contents = "appleID"} 1 : {contents = "kPCSSetupDSID"} = {contents = "<>"} 2 : {contents =
"kPCSSetupPassword"} = {contents = "<>"} } Oct 17 00:38:17
hostname.local com.apple.iCloudHelper[1284] :
__PCSAccountHasStingrayIdentities Oct 17 00:38:19 hostname.local com.apple.iCloudHelper[1284] : PCSHasStingrayIdentities: YES Oct 17
00:38:21 hostname.local com.apple.iCloudHelper[1284] :
PCSCopyStingrayIdentity: {length = 1845, capacity = 1845, bytes =
0x628207313082072d0c0f67616d63616c ... ab42b25d58020101} (error:
(null)) Oct 17 00:38:21 hostname.local com.apple.iCloudHelper[1284] :
PCSIdentityCollectionSetup failed The operation couldn’t be completed.
(OSStatus error -25244 - SecItem failed to delete on private identity)
用户当前设备(或他们刚刚与其帐户关联的任何其他共享设备)上的 iCloud 钥匙串同步组合,或更改 permissions/deleting 并重建与该用户的 [=27] 关联的共享 iCloud 文件夹=] 应该可以解决这个问题。
相关讨论:
Apple Stack Exchange - Setting up iCloud results in cloudd error messages
Apple Support Communities - after upgrading to Yosemite iMac reboots random reboots randomly
我遇到了一个问题。使用云工具包将图像上传到 icloud
时抛出错误。它抛出以下错误:
(< CKError 0x7ffad06b6780: "Internal Error" (1/5000); "Couldn't create a PCS identity">)
当图片没有和其他数据一起上传时,其他数据上传成功。 这里我提供了我用来设置上传图片的代码。
var noteRecord: CKRecord!
if let url = imageURL {
let imageAsset = CKAsset(fileURL: url)
print("imageAsset \(imageAsset)")
noteRecord.setObject(imageAsset, forKey: "noteImage")
}
这是一个特定于用户的问题,在用户在其其中一台设备上启用 iCloud Drive 后,iCloud Keychain 和 iCloud Drive 文件夹会出现此问题。
示例日志:
Oct 17 00:38:17 hostname.local com.apple.iCloudHelper[1284] : PCSIdentityCollectionSetup: {type = mutable dict, count = 3, entries => 0 : {contents = "kPCSSetupUsername"} = {contents = "appleID"} 1 : {contents = "kPCSSetupDSID"} = {contents = "<>"} 2 : {contents = "kPCSSetupPassword"} = {contents = "<>"} } Oct 17 00:38:17 hostname.local com.apple.iCloudHelper[1284] : __PCSAccountHasStingrayIdentities Oct 17 00:38:19 hostname.local com.apple.iCloudHelper[1284] : PCSHasStingrayIdentities: YES Oct 17 00:38:21 hostname.local com.apple.iCloudHelper[1284] : PCSCopyStingrayIdentity: {length = 1845, capacity = 1845, bytes = 0x628207313082072d0c0f67616d63616c ... ab42b25d58020101} (error: (null)) Oct 17 00:38:21 hostname.local com.apple.iCloudHelper[1284] : PCSIdentityCollectionSetup failed The operation couldn’t be completed. (OSStatus error -25244 - SecItem failed to delete on private identity)
用户当前设备(或他们刚刚与其帐户关联的任何其他共享设备)上的 iCloud 钥匙串同步组合,或更改 permissions/deleting 并重建与该用户的 [=27] 关联的共享 iCloud 文件夹=] 应该可以解决这个问题。
相关讨论:
Apple Stack Exchange - Setting up iCloud results in cloudd error messages
Apple Support Communities - after upgrading to Yosemite iMac reboots random reboots randomly