J'ai la méthode suivante pour effectuer affichage de l'image animée:Obtenir EXC_BAD_ACCESS lors de l'utilisation FLAnimatedImage
-(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];
}
Mon but est simple, je veux que mon gif jouer une fois. Mais quand j'ajoute méthode "looopCompletionBlock" je reçois l'erreur suivante:
Thread1: EXC_BAD_ACCESS (Code = 1, adresse = 0x10)
En attente de votre aide, merci :)
Que voulez-vous dire par bloc réel, pouvez-vous donner un exemple? – phantom
Ceci est un bloc:^void (NSUInteger i) {NSLog (@ "test"); } –