每当我单击旋转时,它都会生成此错误并使应用程序崩溃。在我上传图像视图之前,该应用程序运行良好并且旋转很棒。我知道代码可能告诉我出了什么问题,但我在理解这一点时遇到了问题。
下面用粗体表示的是它的生成
- (IBAction)spinAction:(id)sender {
[_chosenComponents removeAllObjects];
for (int i = 0; i < _componentsInPicker.count; i++) {
int randNum = arc4random() % [self.theSlotPicker numberOfRowsInComponent:i];
[_theSlotPicker selectRow:randNum inComponent: i animated:YES];
[_chosenComponents addObject:
[NSNumber numberWithInt:[(NSArray *)[_baseList objectAtIndex:i] indexOfObject:[(NSArray *)[_componentsInPicker objectAtIndex:i] objectAtIndex:randNum]]]];
}
NSLog(@"%@", _chosenComponents);
按下按钮后吐出/崩溃“线程 1:EXC_ARITHMETIC (code=EXC_1386_DIV,subcode=0x0)”
如果可以,请指导我如何解决此错误。
谢谢!
输出错误:(lldb)