xcode pic1

1. we make new project
2. add 2 picture2 to folder
3. drage object image into iphone view
4. write code

Screen Shot 2556-07-08 at 1.44.56 PM

//  ViewController.m
//  myapp3
//
//  Created by Guest User on 7/8/56 BE.
//  Copyright (c) 2556 Petcharaporn. All rights reserved.
//
#import "ViewController.h"
@interface ViewController ()
@end
@implementation ViewController
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
}
- (void)didReceiveMemoryWarning
{
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
- (IBAction)mybotton:(id)sender {
UIImage * imagesource=[UIImage imageNamed:@"v2-cute-cat-picture.jpg"];
_myimage.image=imagesource;
}
@end

-----------------------------------------------------------------------

//  ViewController.h
//  myapp3
//
//  Created by Guest User on 7/8/56 BE.
//  Copyright (c) 2556 Petcharaporn. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface ViewController : UIViewController
- (IBAction)mybotton:(id)sender;
@property (weak, nonatomic) IBOutlet UIImageView *myimage;
@end

----------------------------------------------------------------------

before press bottom

Screen Shot 2556-07-08 at 1.44.58 PM

after press botton picture change to a new one which we have 2 pics in folder

Screen Shot 2556-07-08 at 1.40.51 PMb