传递给touchesEnded:withEvent:

时间:2012-02-17 04:56:48

标签: ios xcode

愚蠢的问题,但你可以通过任何touchesEnded。我想把UIImageView片传给它。我是新手。我知道NSSet是NSObject的子类,所以我认为有一种方法可以通过NSSet以某种方式传递我的UIImageView。

-(void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event{

    if (!isTouchingEmptyField) {

        [UIView beginAnimations:nil context:nil];

        piece.center = CGPointMake(48, 366); 

        [UIView commitAnimations]; 
    }
}

1 个答案:

答案 0 :(得分:0)

你可以这样做,但我不会。

我会在你想要使用选择器添加行为的特定UIViews上使用UIGestureRecognizer来执行该操作。