Quote:
Originally Posted by Zala
Hi all,
I am trying to set it programmatically for the button to jump to a specific page.
Code:
UIBarButtonItem *newBackButton = [[UIBarButtonItem alloc] initWithTitle:@"Back" style: UIBarButtonItemStyleBordered target: self action: pushViewController datamenu];
[[self navigationItem] setBackBarButtonItem: newBackButton];
[newBackButton release];
I made a quick search on this topic as well. Some suggested using action: @selector(methodname). I tried that as well but its still not showing what it should.
|
this way:
//////// left
UIBarButtonItem *editButton= [[UIBarButtonItem alloc]
initWithTitle:@"Add"
style:UIBarButtonItemStyleBordered
target:self
action:@selector(addButton

];
self.navigationItem.leftBarButtonItem =editButton;
[editButton release];
////////right
UIBarButtonItem *moveButton =[[UIBarButtonItem alloc]
initWithTitle:@"move"
style:UIBarButtonItemStyleBordered
target:self
action:@selector(toggleMove)];
self.navigationItem.rightBarButtonItem = moveButton;
[moveButton release];