In my project (“Xcode 4.3.2 – Single View Application”), I have manually added a ToolBar with a button item, i need to update the button label programatically.
How can i do this? Could you please help me?
ViewController.h
#import <UIKit/UIKit.h>
@interface ViewController : UIViewController <UIWebViewDelegate>{
IBOutlet UIWebView *webDisplay;
IBOutlet UIToolbar *menuBar; //my toolBar
}
@property(nonatomic,retain) UIWebView *webDisplay;
@property(nonatomic,retain) UIToolbar *menuBar;
- (IBAction) changeLabel:(id)sender;
@end
ViewController.m
- (IBAction) changeLabel:(id)sender{
//code for updating label
}
Be sure to set the BarButtonItem as Referencing Outlet “barButton”