Below, I think you are missing a bracket at the end of each line..
Code:
- (void)viewDidLoad {
imageArray = [[NSMutableArray alloc] init];
[imageArray addObject:[UIImage imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"rock" ofType:@"jpg"]];
[imageArray addObject:[UIImage imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"paper" ofType:@"jpg"]];
[imageArray addObject:[UIImage imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"scissors" ofType:@"jpg"]];
[super viewDidLoad];
}
And here, I've had trouble with this method. The method above seems to work better. I'm not sure why, but, at least when there are a lot of images, the technique below crashes after a while.
Code:
- (void)viewDidLoad {
imageArray = [[NSMutableArray alloc] init];
[imageArray addObject:[UIImage imageNamed:@"rock.jpg"]];
[imageArray addObject:[UIImage imageNamed:@"paper.jpg"]];
[imageArray addObject:[UIImage imageNamed:@"scissors.jpg"]];
[super viewDidLoad];
}