How can i identify self.editButtonItem button's clicked event?

Confused picture Confused · Sep 7, 2011 · Viewed 12.4k times · Source

I set my left bar button of UINavigationController as edit button using the code

leftBarButton = self.editButtonItem;

I want to change some disable/enable properties of other buttons with respect to the edit button's click action.

How can i find whether the Edit button is pressed or not?

Answer

jrturton picture jrturton · Sep 7, 2011

The edit button's action sends your view controller the setEditing:animated message. Override this in your subclass to perform other actions when entering or leaving edit mode.

Be sure to call the super implementation at the end to manage the rest of the transition to editing view.