我是初学者...... 我有NSUserDefaults来获取UIPicker选项和双值来加载UIPicker的选择。
NSUserDefaults *pickerViewSelectionDefaults = [NSUserDefaults standardUserDefaults];
[pickerWork selectRow:[pickerViewSelectionDefaults integerForKey:@"pickerSelectionMinWork"] inComponent:0 animated:YES];
double dobMinute = [[NSString stringWithFormat:@"%f", [[minArray objectAtIndex:[pickerWork selectedRowInComponent:0]] floatValue]] doubleValue]*60;
如何将 selectedRowInComponent:替换为 selectRow:inComponent:animated:,因为我遇到此错误:
发送'无效'到不兼容类型的参数' NSUInteger' (又名' unsigned long')
提前致谢!
答案 0 :(得分:0)
变化
double dobMinute = [[NSString stringWithFormat:@"%f", [[minArray objectAtIndex:[pickerWork selectedRowInComponent:0]] floatValue]] doubleValue]*60;
到
double dobMinute = [pickerViewSelectionDefaults integerForKey:@"pickerSelectionMinWork"]*60;