我正在开发一个 iPad 应用程序,但我遇到了动画问题。我使用 IBAction 同时启动动画和音频,它们使用 iPad2 同步,但是当我在 iPad 3 和模拟器上运行应用程序时,64 位音频和图像不同步,因为图像有延迟。
这是我的代码:
-(IBAction)Action:(id)sender {
UIButton *Namebutton = (UIButton*) sender;
Namebutton.enabled = NO;
animation.animationImages = [NSArray arrayWithObjects:
GetImgWithoutCachingP6(@“image1.png"),
GetImgWithoutCachingP6(@"image2.png"),
GetImgWithoutCachingP6(@"image3.png"),
GetImgWithoutCachingP6(@"image4.png"),
GetImgWithoutCachingP6(@"image5.png"),
GetImgWithoutCachingP6(@"image6.png"),
GetImgWithoutCachingP6(@"image7.png"),
GetImgWithoutCachingP6(@"image8.png"),
GetImgWithoutCachingP6(@"image9.png"),
GetImgWithoutCachingP6(@"image10.png"),
GetImgWithoutCachingP6(@"image11.png"),
GetImgWithoutCachingP6(@"image12.png"),
GetImgWithoutCachingP6(@"image13.png"),
GetImgWithoutCachingP6(@"image14.png"),
GetImgWithoutCachingP6(@"image15.png"),
GetImgWithoutCachingP6(@"image16.png"),
nil];
animation.animationRepeatCount = 2;
animation.animationDuration = 4.0;
[animation startAnimating];
NSString *Sound = [[NSBundle mainBundle] pathForResource:@“NameSound" ofType:@"wav"];
Scenesound=[[AVAudioPlayer alloc] initWithContentsOfURL:[NSURL fileURLWithPath: Sound] error:NULL];
Scenesound.volume = 4.0;
Scenesound.numberOfLoops = 1;
[Scenesound play];
哪个是问题?
谢谢您的帮助