title: UIPageControl + UIScrollView not counting pages properly
body: <p>I am having an issue with a UIPageControl incrementing the <code>currentPage</code> past an arrays count - 1.  For example; if there are 5 items in the array, it will actually draw 5 dots, but it will only go to number 4.  The control is incremented or decreased based on the paging of the <code>UIScrollView</code> up to (what I thought would be) the maximum number of items in the given array.    Any help would be appreciated.  </p>
  
  <p>Here's the code for the <code>scrollViewDidEndDecelerating</code>:</p>
  
  <pre><code>- (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView
  {
  CGFloat pageWidth = _meatSelectionCollection.frame.size.width;
  self.pageControl.currentPage = _meatSelectionCollection.contentOffset.x / pageWidth;
  NSLog(@"Current Page Test: %ld", (long)self.pageControl.currentPage);
  }
  </code></pre>
  
  <p>I'm detecting the page width in the UIScrollView that determines the current page, and paging in the scroll view is enabled.  However, the <code>NSLog</code> for the current page reads the following output as the page changes:</p>
  
  <pre><code>2014-09-02 21:41:28.359 Burger Grinder[73531:60b] Current Page Test: 0
  2014-09-02 21:41:29.420 Burger Grinder[73531:60b] Current Page Test: 1
  2014-09-02 21:41:30.120 Burger Grinder[73531:60b] Current Page Test: 2
  2014-09-02 21:41:30.870 Burger Grinder[73531:60b] Current Page Test: 3
  2014-09-02 21:41:31.708 Burger Grinder[73531:60b] Current Page Test: 4
  2014-09-02 21:41:32.476 Burger Grinder[73531:60b] Current Page Test: 4
  </code></pre>
  
  <p>It's not incrementing past 4.  The array count that is determining it is returning as 6.  I understand that <code>self.page.currentPage</code> showing <code>4</code> is the result of counting <code>0, 1, 2, 3, 4</code> (i.e. 5 elements), but the count is 6.</p>
  
  <p>Any thoughts on what could be causing this?  Thanks in advance.</p>
  
  <p>EDIT:  Showing Content Offset and PageWidth Logs after increment:</p>
  
  <pre><code>2014-09-02 22:03:52.472 Burger Grinder[73813:60b] Current Page Test: 1
  2014-09-02 22:03:52.472 Burger Grinder[73813:60b] Content Offset.x Value: 244.000000
  2014-09-02 22:03:52.473 Burger Grinder[73813:60b] PageWidth: 244.000000
  2014-09-02 22:03:55.811 Burger Grinder[73813:60b] Current Page Test: 2
  2014-09-02 22:03:55.811 Burger Grinder[73813:60b] Content Offset.x Value: 488.000000
  2014-09-02 22:03:55.812 Burger Grinder[73813:60b] PageWidth: 244.000000
  </code></pre>
  
  <p>In fact, <code>Content Offset.x Value</code> increments even if the count doesn't increase past 4.  It correctly logs the value as <code>1213</code> at the highest level page, but the counter doesn't increase.</p>