我正在使用以下代码
@property (retain, nonatmoic) UIImageView *imgView;
if ( count == 6)
{
[timer invalidate];
imgView= [[UIImageView alloc] initWithFrame:CGRectMake(0,0,320,460)];
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad)
{
imgView.image = [UIImage imageNamed:@"ipad_popover-incorrectguess.png"];
[self.view addSubview:imgView];
}
else if ( UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone)
{
imgView.image = [UIImage imageNamed:@"iphone_popover-incorrectguess.png"];
[self.view addSubview:imgView];
}
UIGestureRecognizer *tap = [[UITapGestureRecognizer alloc]
initWithTarget:self action:@selector(newRound)];
[imgView addGestureRecognizer:tap];
}
}
-(void)newRound
{
[imgView removeFromSuperview];
}
当我点击图像上的任何位置时,似乎从未调用过 newROUND 。
我该如何解决?