Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

cordoprod

macrumors newbie
Original poster
Nov 16, 2009
5
0
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:
Code:
if (self.tableView.editing) {
		NSLog(@"editing");
		
		UIBarButtonItem *addButton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemAdd 
																				   target:self
																				   action:@selector(insertNewObject:)];
		self.navigationItem.leftBarButtonItem = addButton;
		[addButton release];
	}
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.