How to search a parse.com table view. iOS, Swift 1.2, Parse.com 1.7.2
Bizzi Bradbury
164

hey man! got a question for you! i have one tableview working great with your code but modified to my classes and columns…My problem is this pfquery…i want it to return this to my PFTableView….but its a more indepth query and its not returning anything. I know for certain all the columns and classes exist and are working because if i make an array and then append to it i can get out the object….. but i havent been able to return this query correctly. Hopefully you can see my problem :)! thanks man!

func queryForTable() -> PFQuery {

let getAdminquery = PFQuery(className: “Employee”)

getAdminquery.whereKey(“companyEmployee”, equalTo: PFUser.currentUser()!.objectId!)

getAdminquery.findObjectsInBackgroundWithBlock { (objects, error) -> Void in

if error == nil {

if let objects = objects as? [PFObject] {

for object in objects {

let adminFollowingUser = object[“companyAdmin”] as! String

let query = PFQuery(className:”PoolAccount”)

query.whereKey(“userId”,equalTo:adminFollowingUser)

query.findObjectsInBackground()

getAdminquery.orderByAscending(“createdAt”)

self.tableView.reloadData()

}

}

}

}

return getAdminquery

}

}

One clap, two clap, three clap, forty?

By clapping more or less, you can signal to us which stories really stand out.