Reputation: 129
Hi. I'm trying to make Cloud Kit based app. For data fetch I'm using this
privateDatabase.performQuery(query, inZoneWithID: nil) {
results, error in
if error != nil {
print(error)
} else {
print(results)
for item in results {
self.workoutData.append(item as! CKRecord)
}
}
}
but XCode says
'[CKRecord]?' does not have a member named 'Generator'
Can you help me please?
Upvotes: 1
Views: 153
Reputation: 3400
You need to unwrap the CKRecord array like so:
if let res = results {
for item in res! {
//Do things with item
}
}
Upvotes: 1