title: UICollectionView invalid index path crash
body: <p>I am having a crash with UICollectionView attempt to scroll to invalid index path {length = 2, path = 0 - 0}.</p>
  
  <p>Does this mean that my collection view is of size 2 but i'm trying to scroll to section 0 index 0? In which case wouldn't that be a valid scroll?</p>
  
  <p>We have since taken out the unnecessary complication of using an NSFetchedResultsController which could have been causing the crash but i'm still curious about how the error message reads and what it means?</p>
  
  <p>This was the code</p>
  
  <pre><code>void fetch() {
  
     // get data from core data using a FetchRequest
     do a perform fetch to get my item
  
     // loop through to see which index the item I want is at
     loop through result {
        if (my id matches core data id) {
            self.selectedIndex = x;
         }
      }
  
      // get more from core data using a Fetch Request
      create another FetchedResultsController
      do another fetch to get all other items
  
      [self.myCV reloadData];
  
      // find the index path for the item I want to scroll to
      NSIndexPath *indexPath = [NSIndexPath indexPathForItem:self.selectedIndex inSection:0];
  
      [self.myCV scrollToItemAtIndexPath:indexPath atScrollPosition:UICollectionViewScrollPositionCenteredHorizontally | UICollectionViewScrollPositionCenteredVertically animated:NO];
  }
  
  // UICollectionView delegate methods
  - (NSInteger)numberOfSectionsInCollectionView:(UICollectionView *)collectionView {
      return [[self.fetchedResultsController sections] count];
  }
  
  - (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section {
      id&lt;NSFetchedResultsSectionInfo&gt; secInfo = [[self.fetchedResultsController sections] objectAtIndex:section];
      return [secInfo numberOfObjects];
  }
  </code></pre>