I am attempting to add a number of buttons to a uiNavigationBar, but it is not attached to a navigation controller, and I don't want it to be.
I am attempting to add two buttons to the left side of the bar, but the only examples of code I find that allow this involve using the line
self.navigationItem.leftBarButtonItems
obviously, my UINavigationBar is not a navigatinItem.
Here is how I have created my NavBar..
.h
@property (nonatomic, retain) UINavigationBar *navBar;
.m
_navBar = [[UINavigationBar alloc] init];
[_navBar setFrame:CGRectMake(0,0,self.view.bounds.size.width,52)];
[self.view addSubview:_navBar];
I have seen two ways to push items to a nav bar but neither work.
first being..
UIBarButtonItem *barButton = [[UIBarButtonItem alloc]
initWithBarButtonSystemItem:UIBarButtonSystemItemAction
target:self
action:@selector(buttonSettingClicked)];
[[self navigationItem] setLeftBarButtonItem:barButton]
and
self.navigationItem.leftBarButtonItems = _ArrayOfBarButtons;
neither one produces any results... i suspect because my UINavigationBar is not technically a 'navigation item.'
So how can I add items to my NavigationBar?