title: iPhone - numberOfRowsInSection error with array count
body: <p>I am getting the following error if the @"Comments" array is 0 and the other two are 1 or greater.</p>
  
  <pre><code>*** Terminating app due to uncaught exception 'NSRangeException', reason: '*** -[NSMutableArray objectAtIndex:]: index 0 beyond bounds for empty array'
  </code></pre>
  
  <p>This is populating the <code>self.items</code> array.</p>
  
  <p>How can I account for the fact that some of the <code>self.notification</code> (Comments in this case) arrays may be null and still have my code run without throwing this type of error?</p>
  
  <pre><code>NSDictionary *commentsDict = [NSDictionary dictionaryWithObject:self.notification.Comments forKey:@"Comments"];
  NSDictionary *likesDict = [NSDictionary dictionaryWithObject:self.notification.Likes forKey:@"Likes"];
  NSDictionary *friendsDict = [NSDictionary dictionaryWithObject:self.notification.Likes forKey:@"Friends"];
  
  self.items = [NSMutableArray array];
  
  [self.items addObject:commentsDict];
  [self.items addObject:likesDict];
  [self.items addObject:friendsDict];
  </code></pre>
  
  <p>This is the code where it fails:</p>
  
  <pre><code>- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
      NSDictionary *dictionary = [self.items objectAtIndex:section];
      NSArray *array = nil;
  
      if (section == 0) {
          array = [dictionary objectForKey:@"Comments"]; // 0 count
      } else if (section == 1) {
          array = [dictionary objectForKey:@"Likes"]; // 1 count or greater
      } else {
          array = [dictionary objectForKey:@"Friends"]; // 1 count or greater
      }
  
      return [array count];
  }
  </code></pre>