Skip to content

Conversation

@jmcd
Copy link

@jmcd jmcd commented May 23, 2013

I moved the code where the current page is limited (was inline MIN/MAX functions) to a new method used by the property setter, because:

  1. It was possible for clients of the page control to set invalid values
  2. A math error with unsigned ints was causing current page to be set to a large number instead of zero

Previously when currentPage was zero, the code

[self setCurrentPage:MAX(self.currentPage - 1, 0)];

would result in the currentPage being set to (NSUInteger)-1, which is large.

…ading to current page being set to very high number
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant