generate random numbers in iphone
<p>Hi, in one of my applications I have to assign different different sections and in each section I have few imageviews.Ii have to launch a popover on any imageview for that I need that image tag value. Those images tag values I have to distinguise for that I used one varialble called count it will start with zero. It will increment based on number of sections and assign the tag values to the imageviews as</p>

<pre><code>NSString *imageTagStr = [[NSString alloc]initWithFormat:@"%d%d",count,j-1];
image1.tag = [imageTagStr intvalue];
</code></pre>

<p>In this I am assigning the tagvalue to the imageviews and all these imageviews are created programatically using for loop. </p>

<p>Next thing is I have to longpress on any image which is available in any section popover have to come and once the pop over launch I have to select the button available on popover then another view will come.</p>

<p>On that view I will load data that I am getting from array. Here based on imagetag value means substringfromindex:1 by using this I am getting the data available in array.</p>

<p>Now the issue is if number of sections are more than 9 then count will become 10 so if I use substringfromindex means I am getting (like 121 in this tag value is 1 and count is 12 so if I fetch the object from array which is available in 21 means I am getting the wrong data so I have to fix this.) </p>

<p>So to resolve this I feel generating random two digit numbers is good and that number I have to add infornt of image tag value. Then always this will be two digits, but i dont know how to generate non repeated two digit numbers. Please if anyone have any idea pls share with me.</p>

<p>If is there any sample code pls share with me. thanks a lot.</p>
