title: Disable row 0 on selection UIPickerview - iOS
body: <p>I'm trying to disable row 1 on UIPickerView, but it throws me the following error</p>
  
  <pre><code>*** Terminating app due to uncaught exception 'NSRangeException', reason: '*** -[__NSArrayM objectAtIndex:]: index 2147483647 beyond bounds [0 .. 15]'
  </code></pre>
  
  <p>Anyone can suggest me what went wrong here? Here is the code </p>
  
  <pre><code>- (void)pickerView:(UIPickerView *)pickerView didSelectRow:(NSInteger)row inComponent:(NSInteger)component
  {   
     AppDelegate *appdelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
     if ((row &gt; 0)){
          NSLog(@"%@",[locationArray objectAtIndex:row]);
  
          if(flag){
  
          appdelegate.selectedLocation = [locationArray objectAtIndex:row];
          NSLog(@"%@",appdelegate.selectedLocation);
  
         }  else{
  
          appdelegate.selectedLocation = [locationArray objectAtIndex:row];
          NSLog(@"%@",appdelegate.selectedLocation);
  
      }
          [promptLocation addSubview:tapButton];
          [tapButton addTarget:self action:@selector(goToDesireLoc:) forControlEvents:UIControlEventTouchUpInside];
     }else{
      //Don't do anything if row 0 is chosen.
      NSLog(@"do nothing");
     }
  }
  </code></pre>