I have a UISegmentedControl and I have some photos, my initial aim is when ever I click on a particular segment one particular image should appear on the view.

For example: If i have four segments and four images then upon each segment I click I must see a image.

Here I have taken an NSArray and Uploaded all these images using this particular below code:

```
NSArray * images = [NSArray arrayWithObjects:[UIImage imageNamed:@"f.ppg"], [UIImage imageNamed:@"t.ppg"....etc ], nil];

```

and after this I want to attach each particular image to a segment index. So here is the code which I wrote.

```
-(IBAction) segmentActionChanged:(id)sender
{
    int segment = mSegment.selectedSegmentIndex; 
    mImageView.image=[images objectAtIndex:segment]; 
}

```

While compiling the application I am not getting any Images displayed and it is quiting abruptly.

Any help regarding this.