ios - Cloud Kit's performQuery in Swift 2.0 -
hi. i'm trying make cloud kit based app. data fetch i'm using this
privatedatabase.performquery(query, inzonewithid: nil) { results, error in if error != nil { print(error) } else { print(results) item in results { self.workoutdata.append(item as! ckrecord) } } }
but xcode says
'[ckrecord]?' not have member named 'generator'
can me please?
you need unwrap ckrecord array so:
if let res = results { item in res! { //do things item } }
Comments
Post a Comment