ios - Why is the query returning a nil when called in CellForRow method? -


i trying import pffile image , put in cell, error fatal error: index out of range. why getting this? how fix it? importing image correctly?

if let imagepic = object["animal"] as? pfobject{                     if let imageofpic = imagepic["pic"] as? pffile{                         imageofpic.getdatainbackgroundwithblock({ (data: nsdata?, error: nserror?) -> void in                             if(error == nil){                                 let image = uiimage(data: data!)                                 self.imagepro.append(image!)                                 dispatch_async(dispatch_get_main_queue()){                                     self.table.reloaddata()                                 }                              }else{                                 print(error)                             }                          })  func tableview(tableview: uitableview, cellforrowatindexpath indexpath: nsindexpath) -> uitableviewcell {     let cell: extrasescell = table.dequeuereusablecellwithidentifier("extra") as! extrasescell     cell.pic.image = imagepro[indexpath.row]      return cell } 


Comments

Popular posts from this blog

Ansible - ERROR! the field 'hosts' is required but was not set -

customize file_field button ruby on rails -

SoapUI on windows 10 - high DPI/4K scaling issue -