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
Post a Comment