xcode - Swift Compiler Error Command failed due to signal: Segmentation fault: 11 -


clubcomments.removeallobjects() let findclubcommentdata:pfquery = pfquery(classname: "testobject")  findclubcommentdata.findobjectsinbackgroundwithblock {     (objects:[pfobject]?, error:nserror?) -> void in     if (error == nil && objects != nil) {         object:pfobject! in objects!{             self.clubcomments.addobject(object)         }          let array: nsarray = self.clubcomments.reverseobjectenumerator().allobjects         self.clubcomments = array as! nsmutablearray         self.tableview.reloaddata() 

getting error code... suggestions on how fix it? im stuck...

in swift use native collection types, avoids errors. example swift array has function reverse() more efficient reverseobjectenumerator().allobjects

declare clubcomments

var  clubcomments = [pfobject]() 

and try

clubcomments.removeall() let findclubcommentdata = pfquery(classname: "testobject")  findclubcommentdata.findobjectsinbackgroundwithblock {             (objects:[pfobject]?, error:nserror?) -> void in      if error == nil {          self.clubcomments = objects!.reverse()          self.tableview.reloaddata()      } } 

Comments

Popular posts from this blog

java - unable show chart in xls document using jasper reports -

java.lang.RuntimeException: Could not generate dummy secret at sun.security.ssl.RSAClientKeyExchange.<init> -

javascript - How to change image src on success AJAX -