We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
前提在isCycleScroll为YES 接着设置第一个程序崩溃,isCycleScroll为NO的情况程序正常执行
[self.pickerView selectRow:0 inComponent:0 animated:true];
报错位置
- (void)selectRow:(NSInteger)row animated:(BOOL)animated { NSInteger newRow = row; if (self.isCycleScroll) { newRow = row - self.copyOffsetCount; } if (animated) { NSIndexPath *indexPath = [NSIndexPath indexPathForRow:newRow inSection:0]; [self.centerTableView scrollToRowAtIndexPath:indexPath atScrollPosition:UITableViewScrollPositionTop animated:true]; self.selectedRow = row; self.isSelectedRow = true; }else { self.centerTableView.contentOffset = CGPointMake(0, newRow * self.rowHeight); [self scrollViewDidEndDecelerating: self.centerTableView]; } }
这行代码导致的错误 newRow = row - self.copyOffsetCount;
设置第一个位置0的时候,newRow值为负数 [NSIndexPath indexPathForRow:newRow inSection:0] 报错
The text was updated successfully, but these errors were encountered:
现在还会报错吗?我试了一下没有崩溃了
Sorry, something went wrong.
No branches or pull requests
前提在isCycleScroll为YES 接着设置第一个程序崩溃,isCycleScroll为NO的情况程序正常执行
报错位置
这行代码导致的错误
newRow = row - self.copyOffsetCount;
设置第一个位置0的时候,newRow值为负数
[NSIndexPath indexPathForRow:newRow inSection:0] 报错
The text was updated successfully, but these errors were encountered: