【发布时间】:2017-01-04 04:16:45
【问题描述】:
我有以下方法来执行动画图像视图:
-(void) setTheGifHeigt:(int)screenHeight andWidth:(int)screenWidth andSize:(int)size{
image = [[FLAnimatedImage alloc] initWithAnimatedGIFData:[NSData dataWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"mygif" ofType:@"gif"]]];
imageView = [[FLAnimatedImageView alloc] init];
imageView.loopCompletionBlock(0);
imageView.animatedImage = image;
imageView.frame = CGRectMake((screenWidth / 2) - (size / 2), (screenHeight / 2) - (size / 2), size, size);
[self.view addSubview:imageView];
}
我的目标很简单,我希望我的 gif 播放一次。但是当我添加“loopCompletionBlock”方法时,我得到以下错误:
Thread1:EXC_BAD_ACCESS(代码=1,地址=0x10)
等待您的帮助,谢谢:)
【问题讨论】:
标签: ios xcode gif animated-gif