arrayからtableViewにデータをロードしようとしていますが、唯一のイメージがロードされています。そこにコード:目的cデータがtableViewにロードされない
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
CarsTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"cell"];
if(cell == nil){
cell = [[NSBundle mainBundle]loadNibNamed:@"CarsTableViewCell" owner:self options:nil][0];
}
cell.imageCar.image = [UIImage imageNamed:[[_arrayCars objectAtIndex:indexPath.row]objectForKey:@"logo"]];
return cell;
cell.lblName.text = [[_arrayCars objectAtIndex:indexPath.row]objectForKey:@"name"];
cell.lblHP.text = [[_arrayCars objectAtIndex:indexPath.row]objectForKey:@"horse_power"];
cell.lblPrice.text = [[_arrayCars objectAtIndex:indexPath.row]objectForKey:@"price"];
}
私は何を欠場しましたか?
「return cell;」このコードは最後のcellForRowAtIndexPathメソッドを記述してください。 – Mohit