I have a tabViewController with 3 tabs each with it’s own viewController of course.
I created a uibarbutton in navigation bar and would like to call a method on one of the UIViewController
UIBarButtonItem *deleteButton = [[UIBarButtonItem alloc]
initWithBarButtonSystemItem:UIBarButtonSystemItemTrash
target:self
action:@selector(deleteAction:)];
deleteButton.style = UIBarButtonItemStyleBordered;
[buttons addObject:deleteButton];
-(void)deleteAction:(id)sender
{
NotesViewController *notesViewController = [self.storyboard instantiateViewControllerWithIdentifier:@"Notes"];
[notesViewController.tableView setEditing:TRUE];
}
Although the above code doesn’t throw error, it doesn’t do anything either.
1 Answer