Поэтому я хочу сделать заказ на разные товары. В этом
У меня есть пользовательская ячейка uitableview с кнопкой на ней. В дать NSMutualArray с моим IBAction. Это мой IBAction. Я выделил свой массивBestelling в моей viewdidload.
-(IBAction)addProduct:(NSMutableArray *) arrProduct{
[arrayBestelling addObject:arrProduct];
}
Хорошо, это весь мой метод просмотра таблицы.
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = @"Cell";
productTableviewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
NSArray* views = [[NSBundle mainBundle] loadNibNamed:@"productTableviewCell" owner:nil options:nil];
for (UIView *view in views) {
if([view isKindOfClass:[UITableViewCell class]])
{
cell = (productTableviewCell*)view;
}
}
}
if(searching) {
cell.proId.text = [[[copyArrayProducts valueForKey:@"Pro_id"] objectAtIndex:indexPath.row] objectAtIndex:0];
cell.product.text = [[[copyArrayProducts valueForKey:@"Pro_naam"] objectAtIndex:indexPath.row] objectAtIndex:0];
cell.prijs.text = [[[copyArrayProducts valueForKey:@"Pro_prijs"] objectAtIndex:indexPath.row] objectAtIndex:0];
}else {
NSString *strId = [[[arrayProducts valueForKey:@"Pro_id"] objectAtIndex:indexPath.row] objectAtIndex:0];
NSString *strNaam = [[[arrayProducts valueForKey:@"Pro_naam"] objectAtIndex:indexPath.row] objectAtIndex:0];
cell.product.text = strNaam;
cell.proId.text = strId;
NSMutableString *strPrijs = [NSMutableString stringWithString: @"€ "];
[strPrijs appendString:[[[arrayProducts valueForKey:@"Pro_prijs"] objectAtIndex:indexPath.row] objectAtIndex:0]];
cell.prijs.text = strPrijs;
NSString *strAantal = cell.aantal.text;
arrayProBestelling = [[NSMutableArray alloc] init];
[arrayProBestelling addObject:strId];
[arrayProBestelling addObject:strNaam];
[arrayProBestelling addObject:strPrijs];
[arrayProBestelling addObject:strAantal];
}
**[cell.btnadd addTarget:self action:@selector(addProduct:arrayProBestelling) forControlEvents:UIControlEventTouchUpInside]**
return cell;
}
Кто-нибудь может помочь?
РЕДАКТИРОВАТЬ!