I have a tableview and navigation bar on the top.
I have a Edit button on the left of my navigation bar with the following line of code.
self.navigationItem.leftBarButtonItem = self.editButtonItem;
When i click on the edit button, it changes to done button. All is fine so far.
Where do i add code, if i want to do a small operation when the Done button is clicked.?
Best Answer
The button stops committing the changes to your controller class once you override it's default action with
self.editButtonItem.action = @selector(editClicked:);
What you should do is override UIViewController's setEditing method in your own controller class:
You also need to set your UIBarButtonItem to "Edit" in storyboard or if you prefer doing it in code use the following:
editButtonItem is a helper property already set by the system for your comfort.