UIImageViewで画像表示
xxxViewController.h
#import <UIKit/UIKit.h> @interface xxxViewController : UIViewController { UIImageView *imageView; } @property (nonatomic, retain) IBOutlet UIImageView *imageView; @end
xxxViewController.m
@implementation xxxViewController @synthesize imageView; // Implement viewDidLoad to do additional setup after loading the view, typically from a nib. [super viewDidLoad]; imageView.image = [ UIImage imageNamed: @"hoge.png" ]; }
Resources の下のxxxViewController.xib を開いてInterface Builderを起動
File's Owner を選択して Library から ImageView を View に設置(D&D)
File's Owner を右クリックして Outlets から imageView を選択して View の UIImageView と結ぶ
ビルドと実行 を行うと Simulator が立ち上がって実行される