ICViewPager
ICViewPager copied to clipboard
Fix crash when switch the data source
crash (100%) steps:
- set the ViewPagerController’s data source, total count is 10;
- select the active page as 9;
- i want to change the data source to another data source, total count maybe is 5. So i call ViewPagerController reloadData.
- 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]]
Tried it on my fork and works like a charm! should be merged as soon as possible