just switched over to Swift2, and am getting this compiler error. Can someone tell me what's wrong with this code?
nameSpotQuery.findObjectsInBackgroundWithBlock{(results: [AnyObject]?, error: NSError?) -> Void in
if error != nil {
print(error)
}
if let objects = results as? [PFObject]{
self.searchResults.removeAll(keepCapacity: false)
for object in objects {
let name = object.objectForKey("Name") as! String
self.searchResults.append(name)
}
dispatch_async(dispatch_get_main_queue()){
self.collectionView.reloadData()
self.searchBars.resignFirstResponder()
}
}
}
dispatch_async(dispatch_get_main_queue()){- egor.zhdanfindObjectsInBackgroundWithBlock, you will probably find, that even if you comment out everything inside, it won't compile - Daniel