Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ...
- - (void)viewDidLoad
- {
- [super viewDidLoad];
- cellTitles = [[NSArray alloc] initWithObjects:@"Smell", @"Taste", @"Suits", @"Notes", nil];
- }
- - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
- {
- return [cellTitles count];
- }
- - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
- {
- return [cellTitles count] / [cellTitles count];
- }
- - (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section
- {
- return [cellTitles objectAtIndex:section];
- }
- - (AddInfoCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
- {
- static NSString *cellIdentifier = @"AddInfoCell";
- AddInfoCell *addInfoCell = [tableView dequeueReusableCellWithIdentifier:cellIdentifier];
- if (addInfoCell == nil) {
- addInfoCell = [[AddInfoCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellIdentifier];
- }
- addInfoCell.cellTextView.delegate = self;
- return addInfoCell;
- }
- -(IBAction)nextButtonPressed:(id)sender {
- ...
- [[dataSource objectAtIndex:dataSourceIndex] setObject:* forKey:@"Smellnote"];
- [[dataSource objectAtIndex:dataSourceIndex] setObject:** forKey:@"Tastenote"];
- //etc
- …
- }
- cell.dataSource = self.dictionary;
- cell.dataKey = @"Tastenote";
- //in cell .m
- //textFieldDelegate method...
- [self.dataSource setObject:self.cellTextView.text forKey:self.dataKey];
Add Comment
Please, Sign In to add comment