原代码
if (index >= self.labels.count) index = self.labels.count - 1;
HWCursorLabel *label = [self.labels objectAtIndex:index];
[label startAnimating];
self.currentLabel = label;
修改为
if (index < self.labels.count) {
HWCursorLabel *label = [self.labels objectAtIndex:index];
[label startAnimating];
self.currentLabel = label;
}
即可
原代码
if (index >= self.labels.count) index = self.labels.count - 1;
HWCursorLabel *label = [self.labels objectAtIndex:index];
[label startAnimating];
self.currentLabel = label;
修改为
if (index < self.labels.count) {
HWCursorLabel *label = [self.labels objectAtIndex:index];
[label startAnimating];
self.currentLabel = label;
}
即可