ストーリーボードにセル プロトタイプがあります。そこで、高さ、サブビュー (ラベルと画像) をカスタマイズします。しかし、最終的にセルは SearchDisplayController に使用されていないようです... コード スニペット >>
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
#warning Reusable cell not working for custom cell.
ItemCell *cell = [tableView dequeueReusableCellWithIdentifier:itemCell];
if (cell == nil) {
cell = [[ItemCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:itemCell];
}
if (tableView == self.searchDisplayController.searchResultsTableView){
cell.itemLabel.text = [_filteredList objectAtIndex:indexPath.row];
cell.priceLabel.text = @"RM 7.00";
// TODO : Insert Image Here
} else {
cell.itemLabel.text = [_items objectAtIndex:indexPath.row];
cell.priceLabel.text = @"RM 7.00";
// TODO : Insert Image Here
}
return cell;}
わからない。tableView の代わりに self.tableView を使用しても、次のように表示されます。