title: Random numbers without repetition
body: <p>I am making Quiz app in which i want to generate random numbers without repetition.<br>
  I have searched many things and got the idea but i think i am doing something wrong that's why not getting correct output.  </p>
  
  <p>Here is the code that i used.  </p>
  
  <pre><code>-(int)generater{
  
  NSMutableArray *temp;
  srand([[NSDate date] timeIntervalSince1970]);
  r = 1 + (arc4random() % 11);
  
  if ([temp count] ==0) {
  
      [temp addObject:[NSNumber numberWithInteger:questionnumber]];
      return r;
  
  }
  if ([temp count] &gt;= 1 ){
  
      if (![temp containsObject:[NSNumber numberWithInteger:questionnumber]]) {
  
          return r;
  
      }
      else{
  
          int next=[self generater];
          return next;
      }
  }
  return r;
  }  
  </code></pre>
  
  <p>For next Question,</p>
  
  <pre><code>-(void)askQuestion{
  
  [self generater];
  
  questionnumber = r;
  
  NSInteger row = 0;
  if(questionnumber == 1)
  {
      row = questionnumber - 1;
  }
  else
  {
      row = ((questionnumber - 1) * 11);
  }
  </code></pre>
  
  <p>Can any one suggest me where i am wrong ?</p>