I create nsmutableArray and add images for it. I also create an imageView that I want to show images from an array, I tried to use animationImages, but nothing happened, how can I fix it? here is my code:
//Numbers images UIImage *numberZero = [UIImage imageNamed:@"numberZero.png"]; UIImage *numberOne = [UIImage imageNamed:@"numberOne.png"]; UIImage *numberTwo = [UIImage imageNamed:@"numberTwo.png"]; UIImage *numberThree = [UIImage imageNamed:@"numberThree.png"]; UIImage *numberFour = [UIImage imageNamed:@"numberFour.png"]; UIImage *numberFive = [UIImage imageNamed:@"numberFive.png"]; UIImage *numberSix = [UIImage imageNamed:@"numberSix.png"]; UIImage *numberSeven = [UIImage imageNamed:@"numberSeven.png"]; UIImage *numberEight = [UIImage imageNamed:@"numberEight.png"]; UIImage *numberNine = [UIImage imageNamed:@"numberNine.png"]; //add numbers uiimage to numbersArray numbersArray = [NSMutableArray arrayWithObjects:numberZero, numberOne, numberTwo, numberThree, numberFour, numberFive, numberSix, numberSeven, numberEight, numberNine, nil]; imgview1 = [[UIImageView alloc] init]; imgview1.animationImages = numbersArray; imgview1.animationDuration = 2; imgview1.animationRepeatCount=0; [imgview1 startAnimating]; [imgview1 stopAnimating];
thanks!
objective-c nsmutablearray animation uiimageview
cnaaniomer
source share