ios - Missing argument for parameter #1 in call when using findObjectsInBackgroundWithTarget -
i trying array of pfobjects, [pfobject]
, parse , seeing issue below. missing?
error missing argument parameter #1 in call
func loaddata() { rooms = [pfobject]() users = [pfuser] () self.tableview.reloaddata() let pred = nspredicate(format: "user1 = %@ or user2 = %@", pfuser.currentuser()!, pfuser.currentuser()!) let roomquery = pfquery(classname: "rooms", predicate: pred) //gives information - includekey columns user class roomquery.includekey("user1") roomquery.includekey("user2") roomquery.findobjectsinbackgroundwithtarget{ (results: [anyobject]!, error: nserror!) -> void in if error == nil { self.rooms = results [pfobject] room in self.rooms { let user1 = room.objectforkey("user1") pfuser let user2 = room.objectforkey("user2") pfuser if user1.objectid != pfuser.currentuser() { self.users.append(user1) } if user2.objectid != pfuser.currentuser() { self.users.append(user2) } } self.tableview.reloaddata() } } }
error:
it seems want handle response block decided use findobjectsinbackgroundwithtarget
. should go findobjectsinbackgroundwithblock:. should having this:
roomquery.findobjectsinbackgroundwithblock {(objects: [anyobject]?, error: nserror?) -> void in
Comments
Post a Comment