-1

I have a navigation controller in a class, and i have a uiview class, now i need to hide the navigation item of view controller on click of a button in uiview class, because its a uiview class, am unable to access self.navigationcontroller.navigationitem,.

i tried initializing the viewcontroller like this

CustViewController* custListVC=[[CustViewController alloc]init];
custListVC.navigationController.navigationItem.rightBarButtonItem.enabled=NO;

but this didnt help.

giorashc
  • 13,691
  • 3
  • 35
  • 71
Syed Ismail Ahamed
  • 349
  • 1
  • 6
  • 17
  • 1
    You need to provide more information, it is not quite understandable what exactly you want to achieve: _hide the navigation item of view controller on click of a button in uiview class_ ???? Are you using storyboards or are you doing everything programmatically? Then maybe it would make sense to share more code as well! – nburk Jul 19 '14 at 08:16
  • I have a master View controller (CustViewController), i have a navigation controller in app delegate which am using in every view controller. i have a detail view which is a subclass of UIVIEW(am adding it as subview to masterview). there is a button in detailView on tap of that button i need to hide the navigation item of MasterViewController – Syed Ismail Ahamed Jul 19 '14 at 08:38

1 Answers1

0

you can use custListVC.navigationController.navigationItem.rightBarButtonItem.hidden=YES;

Dheeraj Kumar
  • 441
  • 3
  • 16