title: Displaying factors of a number
body: <p>I want to display every factor of a number typed in a textfield to achieve this I tried using an array. But I am always getting the error <code>'NSRangeException', reason: '*** -[__NSArrayM objectAtIndex:]: index 1 beyond bounds [0 .. 0]'</code> . Any suggestions to eliminate this error?</p>
  
  <pre><code>       NSMutableArray *array;
          array = [NSMutableArray arrayWithCapacity:100];
  
          for (factorsNumber=1; factorsNumber&lt;=number; factorsNumber++) {
              if (number%factorsNumber == 0) {
                  [array addObject:[NSString stringWithFormat:@"%d", factorsNumber]];
              }
  
          }
  
          for (int i = 0; i &lt;= [array count]; i++) {
              factors.text = [NSString stringWithFormat:@"%d", i, [[array objectAtIndex:i] intValue]];
          }
  </code></pre>