UITapGestureRecognizer抛出进程已完成,错误代码为0

时间:2015-09-29 07:42:45

标签: ios objective-c uigesturerecognizer gesture

我有一个带手势识别器的标签(可能是一个带目标的按钮),这是代码示例

- (void)addStartText:(UIView *)view :(UIImageView *)image {
UILabel *btnStart = [[UILabel alloc]init];
btnStart.frame = CGRectMake(CGRectGetMinX(image.frame), CGRectGetMidY(image.frame) - 20,
CGRectGetWidth(image.frame), 40);

btnStart.text = @"xxx";
btnStart.textColor = [UIColor pxColorWithHexValue:@"ff0066"];

btnStart.font = [UIFont fontWithName:@"Impact" size:33];
btnStart.textAlignment = NSTextAlignmentCenter;
[btnStart setUserInteractionEnabled:YES];


UITapGestureRecognizer *gestureRecognizer = [[UITapGestureRecognizer alloc] initWithTarget:self
                                                                              action:@selector(test:)];
[btnStart addGestureRecognizer:gestureRecognizer];

[view addSubview:btnStart];

self.btnStart = btnStart;

[self addDescription :btnStart :view];
}

和接收方法:

- (void)test:(id)test {

}

当我触摸我的标签时,我抛出Process完成退出代码0,

哪里出了问题,

谢谢你!

0 个答案:

没有答案