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

Popular posts from this blog

c - Bitwise operation with (signed) enum value -

xslt - Unnest parent nodes by child node -

YouTubePlayerFragment cannot be cast to android.support.v4.app.Fragment -