ICViewPager icon indicating copy to clipboard operation
ICViewPager copied to clipboard

Fix crash when switch the data source

Open gshe opened this issue 9 years ago • 1 comments

crash (100%) steps:

  1. set the ViewPagerController’s data source, total count is 10;
  2. select the active page as 9;
  3. i want to change the data source to another data source, total count maybe is 5. So i call ViewPagerController reloadData.
  4. ViewPagerController crash, out of range exception

Root Cause is self.activeContentIndex is still 9, NSArray cash when call [self.contents replaceObjectAtIndex:index withObject:[NSNull null]]

gshe avatar Feb 19 '16 08:02 gshe

Tried it on my fork and works like a charm! should be merged as soon as possible

pplant avatar Apr 28 '16 09:04 pplant