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

Popular posts from this blog

python - TypeError: start must be a integer -

c# - DevExpress RepositoryItemComboBox BackColor property ignored -

django - Creating multiple model instances in DRF3 -