and I tested my app with XCode5 beta1,below is the error info:
2013-06-13 10:58:03.867 ...... * Assertion failure in -[SDSegmentedControl setSelectedSegmentIndex:], ...../SDSegmentedControl/SDSegmentedControl.m:269
2013-06-13 10:58:03.980 ..... * Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Invalid parameter not satisfying: selectedSegmentIndex < (NSInteger)self._items.count'
and I tested my app with XCode5 beta1,below is the error info: 2013-06-13 10:58:03.867 ...... * Assertion failure in -[SDSegmentedControl setSelectedSegmentIndex:], ...../SDSegmentedControl/SDSegmentedControl.m:269 2013-06-13 10:58:03.980 ..... * Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Invalid parameter not satisfying: selectedSegmentIndex < (NSInteger)self._items.count'
so the problem:
(void)setSelectedSegmentIndex:(NSInteger)selectedSegmentIndex { if (_selectedSegmentIndex != selectedSegmentIndex) { NSParameterAssert(selectedSegmentIndex < (NSInteger)self._items.count); _lastSelectedSegmentIndex = _selectedSegmentIndex; _selectedSegmentIndex = selectedSegmentIndex; [self setNeedsLayout]; } }
after removed " NSParameterAssert(selectedSegmentIndex <(NSInteger)self._items.count);" the error info: * Terminating app due to uncaught exception 'NSRangeException', reason: '* -[__NSArrayM objectAtIndex:]: index 5 beyond bounds [0 .. 4]'