iPhoneアプリ開発初心者です。で を開発する必要がありUITableview
ます UISearchbar
。デフォルトの aと twoおよび twoでjson
配列を aに表示する必要があります。2 つのボタン機能は + と - で、1 つのラベルはボタン アクションを表示するために使用され、もう 1 つのラベルは配列名を表示するために使用されます。tableView
image
buttons
labels
json
正確に、表示する必要があるのは...特定のセルのラベルのボタンクリック数であり、検索バーで同じアイテムを検索すると同じ数が表示されます。
誰でも私を助けることができます。お願いします....
前もって感謝します。
ここに私が試した私のコードがあります..
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = @"ListOfProductsCell";
ListOfProductsCell *cell = (ListOfProductsCell *)[tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell==nil) {
NSArray *nib =[[NSBundle mainBundle] loadNibNamed:@"ListOfProductsCell" owner:self options:nil];
cell = [nib objectAtIndex:0];
productItemDit=[productListArry objectAtIndex:indexPath.row];
NSString *offerStr= [NSString stringWithFormat:@"%.2f",[[productItemDit objectForKey:@"offer"] floatValue]];
NSString *fullCostStr=[[currencyCodeStr stringByAppendingString:@" "] stringByAppendingString:offerStr];
NSLog(@"%@",fullCostStr);
cell.itemCostLbl.text=fullCostStr;
cell.itemStepper.tag=166;
cell.itemAddedLbl.tag=122;
itemCount=stepperValueArry.count;
cell.itemAddedLbl =(UILabel*)[cell viewWithTag:122];
cell.itemAddedLbl.text = [[NSString alloc] initWithFormat:@"%d",itemCount];
}
cell.itemImg.image = [UIImage imageNamed:@"profp.jpg"];
if (tableView == self.searchDisplayProduct.searchResultsTableView) {
searchProductItemDit=[searchProductListArry objectAtIndex:indexPath.row];
NSLog(@"searchdit:%@",searchProductItemDit);
cell.itemNameLbl.text= [searchProductItemDit objectForKey:@"name"];
self.searchDisplayProduct.searchResultsTableView.separatorColor=[UIColor colorWithRed:200.0 green:0.0 blue:0.0 alpha:1.0];
} else {
productItemDit=[productListArry objectAtIndex:indexPath.row];
NSLog(@"dit:%@",productItemDit);
cell.itemNameLbl.text=[productItemDit objectForKey:@"name"];
}
return cell;
}