Search code examples
iphoneobjective-cios6uibuttonuibarbuttonitem

How to Click/ Press Bar Button on Navigation Item programmatically


I have iPhone as below.

enter image description here

What I want is click Refresh button on clicking the Delete button ** programmatically**.

Note: I have provided tag also to Refresh button.


Solution

  • I assume u have delete and refresh actions say

     -(IBAction)deleteAction:(id)sender 
     -(IBAction)refreshAction:(id)sender:
    

    Now on delete action call refresh action simply like this:

    -(IBAction)deleteAction:(id)sender
    {
        [self refreshAction:btnRefresh]; //provide refresh action along with refersh button
        //I mean here act according to refresh method.
    }