My AppはJSON形式のデータを取得し、テーブルビューで表示します。私は検索方法を実装しようとしていますが、アプリケーションがクラッシュします。何か案は?searchBarメソッドがNSMutableArray(Obj-C)で動作しない
解決方法が見つからないようです。
更新:
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"Cell" forIndexPath:indexPath];
if (!isFiltered) {
Product *productObject;
productObject = [productsArray objectAtIndex:indexPath.row];
cell.textLabel.text = productObject.prodName;
//Accessory.
cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
} else {
Product *productObject;
productObject = [self.filteredProductNameArray objectAtIndex:indexPath.row];
//Accessory.
cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
}
return cell;
}
はい、コードを投稿してください! – Cuckoo
@Cuckooが答えを更新 –
ありがとう、それは完璧に働いた! – Cuckoo