Iphone 如何以编程方式单击/按导航项上的栏按钮

Iphone 如何以编程方式单击/按导航项上的栏按钮,iphone,objective-c,ios6,uibutton,uibarbuttonitem,Iphone,Objective C,Ios6,Uibutton,Uibarbuttonitem,我的iPhone如下 我想要的是在以编程方式**单击Delete按钮**时单击Refresh按钮 注意:我还为刷新按钮提供了标签。我假设您有删除和刷新操作 -(IBAction)deleteAction:(id)sender -(IBAction)refreshAction:(id)sender: 现在执行删除操作调用刷新操作如下所示: -(IBAction)deleteAction:(id)sender { [self refreshAction:btnRefresh]; /

我的iPhone如下

我想要的是在以编程方式**单击
Delete
按钮**时单击
Refresh
按钮


注意:我还为
刷新按钮提供了标签。

我假设您有
删除和刷新操作

 -(IBAction)deleteAction:(id)sender 
 -(IBAction)refreshAction:(id)sender:
现在执行
删除操作
调用
刷新操作
如下所示:

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

为什么不使用uibutton初始化rightbarbutton项并在其单击时执行选择器?您可以在任何时候调用它的方法。我认为同一个按钮不能同时具有动作和属性。。所以我不能给刷新按钮命名为
btnRefresh
。我没有得到评论中写的内容。什么是
btnRefresh
。它是否连接到刷新按钮?