title: iOS For Loops Printing Array
body: <p>I'm trying to use a for loop to pick letters from an array of letters and then add them to a variable which will then be printed to a Label. </p>
  
  <p>I've written this code, which uses a random number generator to select a random letter from the array and then should join it variable <code>password</code>. However it wasn't displaying anything in Label so I set a breakpoint inside the for loop to see what was happening but it doesn't even seem to be getting into the loop at all, e.g. it doesn't break inside it.</p>
  
  <p>Here is the code I'm using</p>
  
  <pre><code>- (void) tapRecog:(id)sender
  {
      @autoreleasepool 
      {
  
          NSString *password;
          NSArray *alpha = [NSArray arrayWithObjects: @"a", @"b", @"c", @"d", nil];
          int i, ran;
  
          for(i = 0;i == 3;i = i + 1)
          {
              ran = arc4random() % 3;
              password = [password stringByAppendingFormat:[alpha objectAtIndex:ran]];
  
          }
  
          displayPassword.text = password;
      }
  }
  </code></pre>