Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
- {
- return 1;
- }
- - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
- {
- return [[[InventoryStore sharedInventory] allInventories] count];
- }
- - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
- {
- Inventory *p = [[[InventoryStore sharedInventory] allInventories]
- objectAtIndex:[indexPath section]];
- StepperCell *cell = [tableView
- dequeueReusableCellWithIdentifier:@"StepperCell"];
- [cell setController:self];
- [cell setTableView:tableView];
- [[cell nameLabel] setText:[p inventoryName]];
- [[cell valueLabel] setText:
- [NSString stringWithFormat:@"$%d", [p value]]];
- [[cell quantityLabel] setText:
- [NSString stringWithFormat:@"%d", [p quantity]]];
- cell.stepper.value = [p quantity];
- return cell;
- }
- InventoryViewController *inventoryViewController = [[InventoryViewController alloc] initWithStyle:UITableViewStyleGrouped];
- - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
- if (indexPath.row % 2) {
- /* Your cell rendering code goes here */
- }
- else {
- UITableViewCell * blankCell = ....;
- }
- }
- - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
- {
- return (numberOfInventoryItems * 2) - 1;
- }
Add Comment
Please, Sign In to add comment