views:

41

answers:

2

Hello,

I'm working on an app for my client. I'm stuck now.

I don't know how to explain. But i make a photoshop image of it.

http://i.imgur.com/cV4mL.jpg

  1. user tap on parent tablecell.
  2. execute didSelectRowAtIndexPath:(NSIndexPath *)indexPath. User select cell.
  3. parent cell update.

Anyone know what is this called? Do you have tutorial for it?

A: 

Use UINavigationController with UITableViewController as its root controller and when diving deeper, instantiate a different UITableViewController for that and push it on the navigation stack. Popping is similar.

There are good examples for UINavigationController accessible from Apple's docs.

Eiko
hello eiko, do you know how to update the data? from 3 to 1?
neotorama
+1  A: 
// FirstViewController (1st in your Photoshop-design)

...

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
    SecondViewController *secondViewController = [[SecondViewController alloc] init];
    secondViewController.cell = [tableView cellForRowAtIndexPath:indexPath];
    [self.navigationController pushViewController:secondViewController animated:YES];
}

...

-------------------------

// SecondViewController.h

@interface SecondViewController : UITableViewController {
    UITableViewCell *cell;
}

@property (nonatomic, retain) UITableViewCell *cell;

-------------------------

// SecondViewController.m

...

@synthesize cell;

...

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
    self.cell.detailTextLabel.text = @"Something";
    [self.navigationController popViewControllerAnimated:YES];
}

...
Tim van Elsloo
hello tim, do you know how to update the data? from 3 to 1?
neotorama