Xcode - [UITableView _contentOffsetForScrollingToRowAtindexpath:atScrollPosition:]: Zeile (7) beyond bounds (0), section (0).'

Habe ich nur implementiert, die AGPhotoBrowser Klasse in meinem Xcode Projekt und ich bin immer der Fehler:

Terminating app due to uncaught exception 'NSRangeException', reason: '-[UITableView _contentOffsetForScrollingToRowAtIndexPath:atScrollPosition:]: row (7) beyond bounds (0) for section (0).'

Den code, wo der Absturz passiert ist, hier:

#pragma mark - UIScrollViewDelegate
- (void)scrollViewDidScroll:(UIScrollView *)scrollView
{
    if (!self.currentWindow.hidden && !_changingOrientation) {
        [self.overlayView resetOverlayView];

        CGPoint targetContentOffset = scrollView.contentOffset;

        UITableView *tv = (UITableView*)scrollView;
        NSIndexPath *indexPathOfTopRowAfterScrolling = [tv indexPathForRowAtPoint:targetContentOffset];

        [self setupPhotoForIndex:indexPathOfTopRowAfterScrolling.row];
    }
}

Der Absturz scheint zu passieren, sobald ich die Ausfahrt der ViewController wo das umgesetzt wird?

InformationsquelleAutor iOSDec | 2014-09-25

Schreibe einen Kommentar