I need some help with my application.
First I have a TableView which pushed on another View. In the second View I have another TableView and here i have to be able to insert rows.
What I want to to is to replace the back button with an add button when editing mode is on.
How do I do that?
I've tried this in viewDidLoad:
First I have a TableView which pushed on another View. In the second View I have another TableView and here i have to be able to insert rows.
What I want to to is to replace the back button with an add button when editing mode is on.
How do I do that?
I've tried this in viewDidLoad:
Code:
if (self.tableView.editing) {
NSLog(@"editing");
UIBarButtonItem *addButton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemAdd
target:self
action:@selector(insertNewObject:)];
self.navigationItem.leftBarButtonItem = addButton;
[addButton release];
}