Add UIBarButtonItem in interface builder, how to?
Posted
by Martin
on Stack Overflow
See other posts from Stack Overflow
or by Martin
Published on 2010-05-31T12:44:43Z
Indexed on
2010/05/31
13:33 UTC
Read the original article
Hit count: 455
I have a navigation based application that have a uinavigataioncontroller containing uitableviewcontrollers. I want to add buttons to the UINavigationbar of the uinavigataioncontroller, usually I write code to add these buttons, something like this:
UIBarButtonItem *saveButton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemSave target:self action:@selector(saveClicked:)];
self.navigationItem.rightBarButtonItem = saveButton;
[saveButton release];
My idea now was to use interface builder instead. But I'm not sure how to do it. What I'm trying to do is to add a UINavigationItem in the xib file of the viewcontroller (my viewcontroller is called TextViewController), something like this:
See this image: http://i48.tinypic.com/qq5yk7.jpg
But how can I make TextViewController use the UINavigationItem I added? The button I add doesn't show in the navigationbar.
Any ideas on how to do this? What am I missing?
© Stack Overflow or respective owner