Hi I need to set the button on right side, in navigation bar, programatically , so that if I press the button I will perform some actions. I have created the navigation bar
Simple use native editBarButton like this
self.navigationItem.rightBarButtonItem = self.editButtonItem;
[self.navigationItem.rightBarButtonItem setAction:@selector(editBarBtnPressed)];
and then
- (void)editBarBtnPressed {
if ([infoTable isEditing]) {
[self.editButtonItem setTitle:@"Edit"];
[infoTable setEditing:NO animated:YES];
}
else {
[self.editButtonItem setTitle:@"Done"];
[infoTable setEditing:YES animated:YES];
}
}
Have fun...!!!