Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>This is simple don't worry about the entire table. Just check for one row. Rest will be done easily. I am assuming you have subclasses UITableView and UITableviewCell (However, this is not required but good practice to make it resuable). </p> <p>First, have delegates for your UITableView :</p> <pre> -(void)didSelectQuantity:(NSUInteger)quantity forIndexPath:(NSIndexpath)indexPath. </pre> <p>Second, Encapsulate item information. </p> <pre> // Assume class NSProduct with property itemName,quantity,etc.. In your controller @property(nonatomic,retain)NSArray *productArray /*Array of NSProduct*/; </pre> <p>Third, In your UITableviewCell implement this <a href="https://stackoverflow.com/questions/1802707/detecting-which-uibutton-was-pressed-in-a-uitableview">logic</a> but for scrollview (I would suggest to use a pickerview here or a UITableView to get selected value easily. Else you need your own logic here to figure out the selected value when scrolling ends)</p> <pre> - (void)valueSelected:(id)sender { CGPoint buttonPosition = [sender convertPoint:CGPointZero toView:self.tableView]; NSIndexPath *indexPath = [self.tableView indexPathForRowAtPoint:buttonPosition]; if (indexPath != nil) { // call delegate. } } </pre> <p>Apple has an excellent example illustrating how to solve such problems using pickerview inside a tableview. <a href="https://developer.apple.com/library/ios/samplecode/DateCell/Listings/MyTableViewController_m.html" rel="nofollow noreferrer">check here</a></p>
    singulars
    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.
    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