I tried to make a function to load data from Parse with SWIFT.
Data is in the "crcl" className in Parse.
I can't pass PFObject
as AnyObject
in my NSMutableArray
"timeLineData".
I have no code error but the app crash at launching.
What should i do, this is my code :
class TimelineTableViewController: UITableViewController {
var timeLineData:NSMutableArray = NSMutableArray ()
func loadData (){
timeLineData.removeAllObjects()
var findTimeLineData:PFQuery = PFQuery(className: "crcl")
findTimeLineData.findObjectsInBackgroundWithBlock{
(objects:[AnyObject]! , error:NSError!)-> Void in
if !error{
for object:AnyObject in objects! {
self.timeLineData.addObject(object as PFObject)
}
self.tableView.reloadData()
}
}
}