iPhone app editing mode

Discussion in 'iPhone/iPad Programming' started by cordoprod, Nov 21, 2009.

  1. macrumors newbie

    Joined:
    Nov 16, 2009
    #1
    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];
    	}
    
     

Share This Page