title: attempt to insert nil object from objects[0]?
body: <p>In my application I have a UITableView and some buttons that the user can click to sort the array to the order based upon some NSDate's or ints. So this is my method to try to sort my UITableView:</p>
  
  <pre><code>- (void)sortStats:(id)sender reloadData:(BOOL)dataBool {
      NSSortDescriptor *descriptor = nil;
      UIButton *clickedButton = (UIButton*)sender;
      if (clickedButton.tag == 1) {
              descriptor = [NSSortDescriptor sortDescriptorWithKey:@"Date" ascending:NO];
      }
      [self.cellArray sortUsingDescriptors:[NSArray arrayWithObject:descriptor]];
      [[NSUserDefaults standardUserDefaults] setObject:self.cellArray forKey:@"cellArray"];
      if (dataBool) {
          [ivstatstableView reloadData];
      }
      [ivstatstableView scrollRectToVisible:CGRectMake(0, 0, 1, 1) animated:YES];
  }
  </code></pre>
  
  <p>So originally I just had this method without the reloadData parameter because it seemed that reloadData on the UITableView was causing the crash. </p>
  
  <p>This is what the console crash log is:</p>
  
  <blockquote>
    <p>Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[__NSPlaceholderArray initWithObjects:count:]: attempt to insert nil object from objects[0]'</p>
  </blockquote>
  
  <p>Anyway is there any code here that would be causing this crash? I really want to get this functionality working in my app and I know I am close to fixing it but I am just not sure whats causing this issue.</p>
  
  <p>Any ideas?</p>