iOS调用按钮通过按钮执行操作

iOS调用按钮通过按钮执行操作,ios,objective-c,Ios,Objective C,我试图通过按钮本身调用连接到按钮的操作。这能做到吗?为了澄清我的观点,我的意思是: [self.button callIBAction:self] 您需要发送触发按钮的事件,例如: [self.button sendActionsForControlEvents:UIControlEventTouchUpInside] 或者,如果您位于执行该操作的同一视图控制器中: [self callIBAction:self.button] 我不得不等一会儿;)我们可以在viewDidLoad中调用

我试图通过按钮本身调用连接到按钮的操作。这能做到吗?为了澄清我的观点,我的意思是:

[self.button callIBAction:self] 

您需要发送触发按钮的事件,例如:

[self.button sendActionsForControlEvents:UIControlEventTouchUpInside]
或者,如果您位于执行该操作的同一视图控制器中:

[self callIBAction:self.button]

我不得不等一会儿;)我们可以在viewDidLoad中调用这些方法吗?
[self performSelector:@selector(yourIBAction:) withObject:nil];