diff --git a/examples/ASDKgram/Sample/PhotoFeedBaseController.m b/examples/ASDKgram/Sample/PhotoFeedBaseController.m index c901d737e2..1d883ba7b1 100644 --- a/examples/ASDKgram/Sample/PhotoFeedBaseController.m +++ b/examples/ASDKgram/Sample/PhotoFeedBaseController.m @@ -59,7 +59,7 @@ [_activityIndicatorView stopAnimating]; - [self insertNewRows:newPhotos]; + [self.tableView reloadData]; [self requestCommentsForPhotos:newPhotos]; // immediately start second larger fetch @@ -74,7 +74,8 @@ NSMutableArray *indexPaths = [NSMutableArray array]; NSInteger newTotalNumberOfPhotos = [_photoFeed numberOfItemsInFeed]; - for (NSInteger row = newTotalNumberOfPhotos - newPhotos.count; row < newTotalNumberOfPhotos; row++) { + NSInteger existingNumberOfPhotos = newTotalNumberOfPhotos - newPhotos.count; + for (NSInteger row = existingNumberOfPhotos; row < newTotalNumberOfPhotos; row++) { NSIndexPath *path = [NSIndexPath indexPathForRow:row inSection:section]; [indexPaths addObject:path]; }