RLPageControl icon indicating copy to clipboard operation
RLPageControl copied to clipboard

Current page limiting refactor

Open jmcd opened this issue 12 years ago • 0 comments

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.

jmcd avatar May 23 '13 15:05 jmcd