I've got this code trying to run a simple set of images in a cycle. All I have in the app is one UIImageView declared in my View Controller's .h file:
@property (strong, nonatomic) IBOutlet UIImageView *imageDisplay;
And the following in my .m file's viewDidLoad method:
NSMutableArray *imageView = [[NSMutableArray alloc] init];
[imageView addObject:[[UIImageView alloc] initWithImage:[UIImage imageNamed:@"EyeAnim1.png"]]];
[imageView addObject:[[UIImageView alloc] initWithImage:[UIImage imageNamed:@"EyeAnim2.png"]]];
[imageView addObject:[[UIImageView alloc] initWithImage:[UIImage imageNamed:@"EyeAnim3.png"]]];
[imageView addObject:[[UIImageView alloc] initWithImage:[UIImage imageNamed:@"EyeAnim4.png"]]];
[imageView addObject:[[UIImageView alloc] initWithImage:[UIImage imageNamed:@"EyeAnim5.png"]]];
[imageView addObject:[[UIImageView alloc] initWithImage:[UIImage imageNamed:@"EyeAnim6.png"]]];
[imageView addObject:[[UIImageView alloc] initWithImage:[UIImage imageNamed:@"EyeAnim7.png"]]];
imageDisplay.animationImages = imageView;
imageDisplay.animationDuration = 0.25;
imageDisplay.animationRepeatCount = 50;
[imageDisplay startAnimating];
The code seems to be crashing on the "imageDisplay.animationImages" line, as if I create the UIImageView, create its getter and setter, and build, it's fine until I uncomment that line. If I do uncomment it, it keeps giving me the error until I delete the UIImageView and create a new one.
Not too sure what's happening, any help appreciated!