0
votes

In my tableview xib i couldn't be able to show navigation bar on run time? My coding as follows

- (void)viewDidLoad
{
ar=[[NSMutableArray alloc]initWithObjects:@"When im happy..i...",@"When im sad.. i...",@"When i'm mad.i...",@"My worst habbit is....",@"The best thing about me is...",nil];
[super viewDidLoad];
self.title=@"Welcome";

self.navigationItem.leftBarButtonItem=self.editButtonItem;
}

The table view doesnt showing the navigation bar.Please help me out

1
do u have navigation base app...Rajneesh071
@Rajneesh071 No.i just open this tableview from uiview button click.digidreamz
MAke your controller a navigationController or add a navigationbar onto the view manually only then you can see the navigation barSuresh Varma
do you have navigation bar in your tableView....if not then how can you think to set navigation bar button...Rajneesh071
that is what my problem.its not showing the navigation bar?@Rajneesh071digidreamz

1 Answers

0
votes

Are you creating self.editButtonItem? Use this code:-

 [self.navigationItem setRightBarButtonItem:[[[UIBarButtonItem alloc]initWithTitle:@"Test" style:UIBarButtonItemStyleBordered target:self action:@selector(test:)]autorelaese]];