Skip to content

Commit

Permalink
[ASDKgram Example] fix crash on startup (#566)
Browse files Browse the repository at this point in the history
* fix crash on ASDKgram startup

* quicker fix
  • Loading branch information
hannahmbanana authored and appleguy committed Sep 16, 2017
1 parent b9b2d7e commit dcaca52
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions examples/ASDKgram/Sample/PhotoFeedBaseController.m
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ - (void)refreshFeed

[_activityIndicatorView stopAnimating];

[self insertNewRows:newPhotos];
[self.tableView reloadData];
[self requestCommentsForPhotos:newPhotos];

// immediately start second larger fetch
Expand All @@ -74,7 +74,8 @@ - (void)insertNewRows:(NSArray *)newPhotos
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];
}
Expand Down

0 comments on commit dcaca52

Please sign in to comment.