[Solved] iOS Multiple Random Image View


This works on my Xcode 4.6.2.

Integrated the comment from @rmaddy.

ViewController.h

#import <UIKit/UIKit.h>

@interface ViewController : UIViewController 
@property (weak, nonatomic) IBOutlet UIImageView *imageView1;
@property (weak, nonatomic) IBOutlet UIImageView *imageView2;

@end

ViewController.m

#import "ViewController.h"

@interface ViewController ()
@end

@implementation ViewController

- (void)viewDidLoad
{
    [super viewDidLoad];

    _imageView1.image = [UIImage imageNamed:[NSString stringWithFormat:@"%d.png", arc4random_uniform(4) + 1]];
    _imageView2.image = [UIImage imageNamed:[NSString stringWithFormat:@"%d.png", arc4random_uniform(4) + 1]];

}

@end

Tip: Using Interface Bilder and Assitant Editor to connect properties.
hope that helps.

3

solved iOS Multiple Random Image View