swift - I cannot fix this bug Cannot invoke 'findObjectsInBackgroundWithBlock' with an argument list of type '(([AnyObject]!, NSError!) -> Void)' -
i tried follow many posts on stackoverflow , google, true. need resolve bug, thanks
my code using parse api
func loaddata(){ timeline.removeallobjects() var findtimelinedata:pfquery = pfquery(classname: "twitter") findtimelinedata.findobjectsinbackgroundwithblock({ (objects: [anyobject]!, error: nserror!) -> void in if error == nil{ object in objects{ let twitter:pfobject = object pfobject self.timeline.addobject(twitter) } let array:nsarray = self.timeline.reverseobjectenumerator().allobjects self.timeline = nsmutablearray(array: array) self.tableview.reloaddata() } }) }
the compiler looking objects , error optional, may nil. try:
findtimelinedata.findobjectsinbackgroundwithblock({(objects: [anyobject?], error: nserror?) -> void in ...
Comments
Post a Comment