To show 25 images randomly out of 40 images in a grid view
<p>I am creating an iphone app in which I need to create a grid view of 25 images.
I am doing that by taking 25 images in an array, and displaying them by using for loop by changing the dimensions for x axis and y axis in below code:</p>

<pre><code>for(int i=0; i&lt;25; i++)
    {
    if(i&gt;0)
    {
        if(i%5==0)
        {
            xaxis=30;
            yaxis=yaxis+35;
        }
    }
        iconButton[i]=[UIButton buttonWithType:UIButtonTypeRoundedRect];
        iconButton[i].frame=CGRectMake(xaxis, yaxis, 50, 30);
        [iconButton[i] setBackgroundImage:[iconArray objectAtIndex:i] forState:UIControlStateNormal];
        [iconButton[i] addTarget:self action:@selector(changeImage:) forControlEvents:UIControlEventTouchUpInside];
        [self.view addSubview:iconButton[i]];
        xaxis=xaxis+55;
    }
</code></pre>

<p>It working fine but I have total 40 images with me and I want every time when application will launch it should pick the 25 images randomly out of that 25 images.</p>

<p>How will I do that, please help me.</p>

<p>Many Thanks in advance for your help.
Regards
iPhoneDeveloper11</p>
