views:

333

answers:

0

Hi Guys, here si my code in appDelegate

- (void)CheckViewToSettingsView:(id)sender {
tabBarController = [[UITabBarController alloc] init]; 
SettingsViewController *view1 = [[SettingsViewController alloc] initWithStyle:UITableViewStyleGrouped];
NotificationSettingsViewController *view2 = [[NotificationSettingsViewController alloc] initWithStyle:UITableViewStyleGrouped];
UINavigationController *tempNavigationController1 = [[UINavigationController alloc] initWithRootViewController:view1];
[tempNavigationController1.navigationBar setBarStyle:2];
UINavigationController *tempNavigationController2 = [[UINavigationController alloc] initWithRootViewController:view2];
[tempNavigationController2.navigationBar setBarStyle:2];
tabBarController.viewControllers = [NSArray arrayWithObjects: view1, view2, nil];

[navigationController pushViewController:tabBarController animated:YES]; }

And here is the code in the NotidicationSettingsViewController.m

  • (id)initWithStyle:(UITableViewStyle)style { if (self = [super initWithStyle:style]) { UIBarButtonItem *addButton = [[UIBarButtonItem alloc] initWithTitle:NSLocalizedString(@"Sign out", @"") style:UIBarButtonItemStyleBordered target:self action:@selector(Logout)]; self.navigationItem.rightBarButtonItem = addButton; [addButton release];

    addButton = [[UIBarButtonItem alloc]
        initWithTitle:NSLocalizedString(@"Back", @"")
        style:UIBarButtonItemStyleBordered
        target:self
        action:@selector(Back)];
    self.navigationItem.leftBarButtonItem = addButton;
    [addButton release];
    self.view.backgroundColor = [UIColor blackColor];
    self.tabBarItem.title = @"Notifications";
    self.tabBarItem.image = [[UIImage imageNamed:@"icon_responsetime.png"] retain];}    return self;}
    

But I cannot see the add button I have just created. Any ideas?