0
我试图在touchesEnded上播放声音,但我遇到问题。有多个对象可以移动,所以如果下面的代码在任何对象移动时都成立,它会不断播放声音。我如何只玩一次?touchesEnded声音?
-(void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event{
if(CGRectContainsRect([image1 frame], [image2 frame])){
[self playsound];
}
}