问题
I get the following error on didReceiveRemoteNotifications if I try to simply print this property, like:
let cloudKitNotification = CKNotification(fromRemoteNotificationDictionary: userInfo as! [String : NSObject])
if cloudKitNotification.notificationType == .Query {
let queryNotification = cloudKitNotification as! CKQueryNotification
print(queryNotification.recordFields)
Could not cast value of type '__NSCFDictionary' (0x273119c) to 'CKRecordValue' (0x2763090).
If I print the whole queryNotification, I can see the recordFields inside of it. I've spent the whole day trying to understand that. Any clues?
Xcode 7.3.1
来源:https://stackoverflow.com/questions/37059790/accessing-recordfields-from-ckquerynotification-swift-2