그래서, 나는 parse.comSWIFT : 완료 핸들러
에서 방법 loadData()
다운로드 datas를하고 난 모든 이미지는 테이블보기에 표시 제시한다.
override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCellWithIdentifier("ReusableCell", forIndexPath: indexPath) as! LeaguesTableViewCell
loadData { (success) in
if success {
cell.leagueImage.image = UIImage(data: self.leaguesImage[indexPath.row])
cell.leagueNameLabel.text = self.leagues[indexPath.row]["name"] as? String
} else {
cell.leagueNameLabel.text = "Wait"
}
}
return cell
}
해당 기능이 작동하지 않습니다. 내가 viewDidLoad()
에서 내 기능을 호출하지만 그 역시 정확하지 않다. 테이블보기는 비어있다. 내 배열 사촌
내
당신이 그것을에 삽입하기 전에 제대로 배열을 "잠금"된다, 또한 ... "작동하지 않았다"설명? – Brandon
그냥 cellForAtIndexPath 메소드에 가지 마라. 테이블 뷰가 비어있다. –
셀이 보이지 않으면 delegate 구현의 'numberOfRowsInSection'과'numberOfSectionsInTableView'가 틀리다 (0을 반환). 그 또는 결코 당신은 tableView 데이터 소스 및 위임을 설정하지 마십시오. – Brandon