Guest User

Untitled

a guest
Jan 15th, 2019
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.35 KB | None | 0 0
  1. ...
  2. - (void)viewDidLoad
  3. {
  4. [super viewDidLoad];
  5. cellTitles = [[NSArray alloc] initWithObjects:@"Smell", @"Taste", @"Suits", @"Notes", nil];
  6. }
  7.  
  8. - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
  9. {
  10. return [cellTitles count];
  11. }
  12.  
  13. - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
  14. {
  15. return [cellTitles count] / [cellTitles count];
  16. }
  17.  
  18. - (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section
  19. {
  20. return [cellTitles objectAtIndex:section];
  21. }
  22.  
  23. - (AddInfoCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
  24. {
  25. static NSString *cellIdentifier = @"AddInfoCell";
  26.  
  27. AddInfoCell *addInfoCell = [tableView dequeueReusableCellWithIdentifier:cellIdentifier];
  28.  
  29. if (addInfoCell == nil) {
  30. addInfoCell = [[AddInfoCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellIdentifier];
  31. }
  32. addInfoCell.cellTextView.delegate = self;
  33.  
  34. return addInfoCell;
  35. }
  36.  
  37. -(IBAction)nextButtonPressed:(id)sender {
  38. ...
  39. [[dataSource objectAtIndex:dataSourceIndex] setObject:* forKey:@"Smellnote"];
  40. [[dataSource objectAtIndex:dataSourceIndex] setObject:** forKey:@"Tastenote"];
  41. //etc
  42. }
  43.  
  44. cell.dataSource = self.dictionary;
  45. cell.dataKey = @"Tastenote";
  46. //in cell .m
  47. //textFieldDelegate method...
  48. [self.dataSource setObject:self.cellTextView.text forKey:self.dataKey];
Add Comment
Please, Sign In to add comment