I would like to know how to add a UIImageView into an NSArray without it crashing.
Currently I am doing this.
//.h
@property (strong, nonatomic) UIImageView *transButtonImageView;
@property (strong, nonatomic) UIImage *transButtonImage;
//.m
@synthesize transButtonImageView;
@synthesize transButtonImage;
transButtonImage = [UIImage imageNamed:@"trans.png"];
[transButtonImageView setImage:transButtonImage];
NSMutableArray *arrayOfButtonImages = [[NSMutableArray alloc] init];
[arrayOfButtonImages addObject:transButtonImageView]; // this is where the error happens
When I try to add transButtonImageView to the NSArray if I look at the value of the imageView it's set at nil, even though I have added the image?