我有一些多方面的问题。
这是我法典的一部分。
-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event{
UITouch *touch = [touches anyObject];
CGPoint pt = [touch locationInView:self.view];
if(pt.x>634 && pt.x<733 && pt.y >64 && pt.y<145)
{
NSString *path = [[NSBundle mainBundle] pathForResource:@"si" ofType:@"mp3"];
theAudio = [[AVAudioPlayer alloc] initWithContentsOfURL:[NSURL fileURLWithPath:path] error:NULL];
theAudio.delegate = self;
[theAudio play];
}
if(pt.x>634 && pt.x<733 && pt.y >195 && pt.y<276)
{
NSString *path = [[NSBundle mainBundle] pathForResource:@"la" ofType:@"mp3"];
theAudio = [[AVAudioPlayer alloc] initWithContentsOfURL:[NSURL fileURLWithPath:path] error:NULL];
theAudio.delegate = self;
[theAudio play];
}
-(void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event{}
-(void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event{
NSString *path = [[NSBundle mainBundle] pathForResource:@"rest" ofType:@"mp3"];
theAudio = [[AVAudioPlayer alloc] initWithContentsOfURL:[NSURL fileURLWithPath:path] error:NULL];
theAudio.delegate = self;
[theAudio play];
}
我希望这能够奏效。
实际上,第二个“如果(安排)和计划;和(安排)”“部分工作”。 谁能告诉我解决办法?
第一个范围的工作,我希望第二个范围能够发挥“作用3”的作用,但当2个手.倒时,它就没有做任何音乐。