Hi guys I'm trying to print my query which Ive created in Parse, here it is this works fine and does what i need it to
//store my currentLocations here
var locations : [PFObject] = []
PFGeoPoint.geoPointForCurrentLocationInBackground { (geoPoint:
PFGeoPoint?, error: NSError?) -> Void in
if geoPoint != nil {
var geoPointLon = geoPoint?.longitude
var geoPonitLan = geoPoint?.latitude
var currentLocation = PFGeoPoint(latitude: geoPonitLan!, longitude: geoPointLon!)
var query = PFQuery(className: "User")
query.whereKey("currentLocation", nearGeoPoint: currentLocation, withinKilometers: 5.0)
query.findObjectsInBackgroundWithBlock({ (objects: [AnyObject]?, error: NSError?) -> Void in
if let myObject = objects as? [PFObject] {
for objects in myObject {
self.locations.append(objects)
}
}
self.tableView.reloadData()
})
}
}
this is my tableview cell and number of rows
func tableView(tableView: UITableView, numberOfRowsInSection section:
Int) -> Int {
return self.locations.count
}
func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
let cell = UITableViewCell()
cell.textLabel?.text = "test"
return cell
}
when running my app "test" does print the correct number of entries so I know my query is working.
My question is how can I print the actual locations from my class "User", column named "currentLocation" within Parse?
if you need any other info just let me know thanks