我有这是viewDidLoad:
// Set up register button
UIButton *registerButton = [UIButton buttonWithType:UIButtonTypeSystem];
[registerButton setTitle:@"Register" forState:UIControlStateNormal];
registerButton.frame = CGRectMake(0.0, 0.0, self.screenWidth / 2.0, 100.0);
和这个:
- (IBAction)buttonPressed:(UIButton *)sender
{
}
我的 .h 文件中也有这个:
@property (nonatomic, weak) IBOutlet UIButton *registerButton;
如何将 IBOutlets 和 IBActions 连接到我在代码中创建的按钮?