Navigation application with TabBar

I have a navigation-based application that shows a TableView in which you can select a cell, and it will lead you to a "detailed view" for that cell. I want this view to have a tabbar in which I can choose one of three subzones. I found several solutions on the Internet for this, but none are very useful. Is there a tutorial for this specifically or their source code indicating how this can be done? Thanks

+3
source share
3 answers

Basically, what you need to do is push the table view controller onto the stack of the navigation manager dispatcher.

" ". RootViewController.m:

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
//Navigation logic may go here. Create and push another view controller.
UIViewController *viewOneViewController =   [[UIViewController alloc] init];
viewOneViewController.title = @"One";
viewOneViewController.view.backgroundColor = [UIColor redColor];

UIViewController *viewTwoViewController =   [[UIViewController alloc] init];
viewTwoViewController.title = @"Two";
viewTwoViewController.view.backgroundColor = [UIColor orangeColor];

UIViewController *viewThreeViewController = [[UIViewController alloc] init];
viewThreeViewController.title = @"Three";
viewThreeViewController.view.backgroundColor = [UIColor greenColor];

UITabBarController *anotherViewController = [[UITabBarController alloc] init];
anotherViewController.viewControllers = [NSArray arrayWithObjects:viewOneViewController, viewTwoViewController, viewThreeViewController, nil];
[self.navigationController pushViewController:anotherViewController animated:YES];
[anotherViewController release];

}

:

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    return 25;
}

, , , . , , - UIViewControllers , . ( Interface Builder, init initWithNibNamed:).

, .

+6

, Apple , .

" "

, 4. ( ).

, , , , .

+2

. "Tweetie" - . TableView , TabBar.

, Apple Documentation:

pushViewController: : .

  • (void) pushViewController: (UIViewController *) viewController : (BOOL)

ViewController , . . , .

YES, . , .

, , , TabBar, TabBarController?

-JP

+1

Source: https://habr.com/ru/post/1704012/


All Articles