Reputation: 138
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.
https://i.sstatic.net/cV4mL.jpg
Anyone know what is this called? Do you have tutorial for it?
Upvotes: 0
Views: 487
Reputation: 10251
// 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];
}
...
Upvotes: 1
Reputation: 25632
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.
Upvotes: 0