Objective c 如何将自定义按钮与xcode 5中的下一个viewcontroller连接

Objective c 如何将自定义按钮与xcode 5中的下一个viewcontroller连接,objective-c,button,xcode5,Objective C,Button,Xcode5,我创建了一个自定义按钮,如下所示: -(void)addYellowBtn{ UIButton *customButton = [UIButton buttonWithType:UIButtonTypeRoundedRect]; [customButton setBackgroundImage:[UIImage imageNamed: @"yellow3.jpg"]forState:UIControlStateNormal]; //sets background imag

我创建了一个自定义按钮,如下所示:

-(void)addYellowBtn{
    UIButton *customButton = [UIButton buttonWithType:UIButtonTypeRoundedRect];
   [customButton setBackgroundImage:[UIImage imageNamed: @"yellow3.jpg"]forState:UIControlStateNormal];
     //sets background image for highlighted state
    [customButton setBackgroundImage:[UIImage imageNamed: @"yellow5.jpg"] forState:UIControlStateHighlighted];
    [customButton setFrame:CGRectMake(60, 100, 60, 60)];
    [customButton setTitle:@"" forState:UIControlStateNormal];

        CALayer *btnLayer = [customButton layer];
        [btnLayer setMasksToBounds:YES];
        [btnLayer setCornerRadius:12.0f];
    [self.view addSubview:customButton];
    [customButton addTarget:self action:(btnclick1:) forControlEvents:UIControlStateNormal];
    }
单击此按钮时,必须按下下一个视图。要执行此操作,我如何编写编码?

更改此选项:

   [customButton addTarget:self action:(btnclick1:) forControlEvents:UIControlStateNormal];
对此

   [customButton addTarget:self action:(btnclick1:) forControlEvents: UIControlEventTouchUpInside];

UIControlStateNormal不是触摸事件。

您的问题不清楚,是否要显示另一个ViewController?可能重复事实上这里有一些错误。这是我的按钮片段。[addTarget:self action:@selector:forControlEvents:UIControlEventTouchUpInside];-您还需要@selector