In meinem Projekt ("Xcode 4.3.2 - Single View Application") habe ich manuell eine ToolBar mit einem Button Item hinzugefügt, ich muss die Tastenbeschriftung programmatisch aktualisieren. Wie kann ich das tun? Kannst du mir bitte Helfen?xCode - Toolbar Schaltfläche Element Bezeichnung ändern
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
}
möglich Duplikat [Ändern Sie den Text eines UILabel (UIBarButtonItem) auf einer Symbolleiste programmatisch] (http://stackoverflow.com/questions/1225457/change-the-text-of-a-uilabel-uibarbuttonitem -on-a-toolbar-programmatisch) – Gray