stop choose image if last image case selected
<p>I pressed the button "background1" 
"background 4.jpg" viewed...
push the button again (background1)
returning to background 1.jpg 
I want to stop, background 4.jpg. (not return background 4.jpg to background 1.jpg)</p>

<pre><code>- (IBAction)background1 {
    x++;
    if (x&gt;3) x=0;
    [self updateImage];
}

-(IBAction)background2 {
    x--;
    if (x&lt;0) x=3;
    [self updateImage];
}

- (void)updateImage {

    switch(x) {
        case 0: [bg setImage:[UIImage imageNamed:@"background 1.png"]];
            break;
        case 1: [bg setImage:[UIImage imageNamed:@"background 2.jpg"]];
            break;
        case 2: [bg setImage:[UIImage imageNamed:@"background 3.jpg"]];
            break;
        case 3: [bg setImage:[UIImage imageNamed:@"background 4.jpg"]];
            break;
    }
}
</code></pre>
