title: Create UIPickerView NSArray out of bounds?
body: <p>I try to create a emoji UIPikcerView.Here's part of my code:</p>
  
  <pre><code>...
  - (void)viewDidLoad {
       [super viewDidLoad];
       _imageArray = @[@"", @"", @"", @"", @"", @"", @"", @"", @"", @""];
  
  
       _dataArray1 = [NSMutableArray arrayWithCapacity:100];
       _dataArray2 = [NSMutableArray arrayWithCapacity:100];
       _dataArray3 = [NSMutableArray arrayWithCapacity:100];
  
       for(int i=0;i &lt; 100; i++){
         [_dataArray1 addObject:[NSNumber numberWithInt:(int)(arc4random() % 10)]];
         [_dataArray2 addObject:[NSNumber numberWithInt:(int)(arc4random() % 10)]];
         [_dataArray3 addObject:[NSNumber numberWithInt:(int)(arc4random() % 10)]];
  }
  }
  ...   
  </code></pre>
  
  <p>And in the UIPickerView Delegate Method:</p>
  
  <pre><code>-(UIView *)pickerView:(UIPickerView *)pickerView viewForRow:(NSInteger)row forComponent:(NSInteger)component reusingView:(UIView *)view{
  UILabel *pickerLabel = [[UILabel alloc]init];
  
  //debug code
  NSNumber *i = [NSNumber numberWithInt:(int)_dataArray1[row]];
  
  if (component == 0) {
      pickerLabel.text = _imageArray[(int)_dataArray1[row]];
  }else if (component == 1){
      pickerLabel.text = _imageArray[(int)_dataArray2[row]];
  }else{
      pickerLabel.text = _imageArray[(int)_dataArray3[row]];
  }
  
  return pickerLabel;
  }
  </code></pre>
  
  <p>When I run my code,the console out put '<strong>Terminating app due to uncaught exception 'NSRangeException'</strong>'.And I add a debug code just like the comment</p>
  
  <pre><code>   NSNumber *i = [NSNumber numberWithInt:(int)_dataArray1[row]];
  </code></pre>
  
  <p>I found when the i equals 146,the app crashed.I really get confused where the
  '146' come from.And I also type a '<strong>po _dataArray1</strong>' in console, there is no 146 in the _dataArray1.Anyone can help me?</p>