Note that there are some explanatory texts on larger screens.

plurals
  1. POAdd IBAction to a button in a custom UItableviewCell
    primarykey
    data
    text
    <p>So I want to make an order of different products. In this I have a custom uitableview cell with a button on it. In give a NSMutualArray with my IBAction. This is my IBAction. I allocated my arrayBestelling in my viewdidload.</p> <pre><code>-(IBAction)addProduct:(NSMutableArray *) arrProduct{ [arrayBestelling addObject:arrProduct]; } </code></pre> <p>Ok this is my whole tableviewMethod.</p> <pre><code>- (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; } </code></pre> <p>Anybody can help?</p> <p>EDIT !</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload