Skip to content
Browse files

Small fix to the demo

  • Loading branch information...
1 parent 197b7b6 commit 2b48dac9b602f906704a4b581917b6b6edb4817a @ultragtx committed May 22, 2012
Showing with 2 additions and 2 deletions.
  1. +2 −2 BookShelf/ViewController.m
View
4 BookShelf/ViewController.m
@@ -54,7 +54,7 @@ - (void)initBooks {
_bookArray = [[NSMutableArray alloc] initWithCapacity:numberOfBooks];
_bookStatus = [[NSMutableArray alloc] initWithCapacity:numberOfBooks];
for (int i = 0; i < numberOfBooks; i++) {
- NSNumber *number = [NSNumber numberWithInt:i];
+ NSNumber *number = [NSNumber numberWithInt:i % 4 + 1];
[_bookArray addObject:number];
[_bookStatus addObject:[NSNumber numberWithInt:BOOK_UNSELECTED]];
}
@@ -157,7 +157,7 @@ - (UIView *)bookShelfView:(GSBookShelfView *)bookShelfView bookViewAtIndex:(NSIn
}
[bookView setIndex:index];
[bookView setSelected:[(NSNumber *)[_bookStatus objectAtIndex:index] intValue]];
- int imageNO = [(NSNumber *)[_bookArray objectAtIndex:index] intValue] % 4 + 1;
+ int imageNO = [(NSNumber *)[_bookArray objectAtIndex:index] intValue];
[bookView setBackgroundImage:[UIImage imageNamed:[NSString stringWithFormat:@"%d.png", imageNO]] forState:UIControlStateNormal];
return bookView;
}

0 comments on commit 2b48dac

Please sign in to comment.
Something went wrong with that request. Please try again.