charvo_a

Untitled

Sep 1st, 2014
304
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
  2.     NSString *sectionTitle = [aromaSectionTitles objectAtIndex:indexPath.section];
  3.     NSArray *sectionAroma = [tableData objectForKey:sectionTitle];
  4.     NSString *aromaLabel = [sectionAroma objectAtIndex:indexPath.row];
  5.     NSLog(@"%@", aromaLabel);
  6. }
  7.  
  8. - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
  9. {
  10.     static NSString *simpleTableIdentifier = @"SimpleTableItem";
  11.    
  12.     UITableViewCell *cell = [self.tableView dequeueReusableCellWithIdentifier:simpleTableIdentifier forIndexPath:indexPath];
  13.    
  14.     // Configure the cell...
  15.     NSString *sectionTitle = [aromaSectionTitles objectAtIndex:indexPath.section];
  16.     NSArray *sectionAroma = [tableData objectForKey:sectionTitle];
  17.     NSString *aromaLabel = [sectionAroma objectAtIndex:indexPath.row];
  18.     cell.textLabel.text = aromaLabel;
  19.    
  20.     if (cell == nil) {
  21.         cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:simpleTableIdentifier];
  22.     }
  23.     cell.textLabel.userInteractionEnabled = YES;
  24.     cell.textLabel.tag = indexPath.row;
  25.    
  26.     return cell;
  27. }
Advertisement
Add Comment
Please, Sign In to add comment