Thursday, April 12, 2012

setting Title for navigation bar in xcode

I have created a navigation controller programmatically,



        //Creating AddViewController Object
addViewController *addView = [[addViewController alloc]init];
UINavigationController *addViewControl = [[UINavigationController alloc]init];

[addViewControl.view addSubview:addView.view];

[self presentModalViewController:addViewControl animated:YES];


But when i add self.title = @"Title" in addViewController class. it is not displaying.



i tried with the following,



self.navigationItem.title = @"Title";

self.navigationController.navigationBar.topItem.title = @"Title";


But it's not displaying Title.



I think it is possible to do with setting a label. but the above one is direct method.



Any Idea..





No comments:

Post a Comment