实现功能要求:根据pickerView中第一和第二个选项决定输出的具体数字,代码如下:
-(void)pickerView:(UIPickerView *)pickerView didSelectRow:(NSInteger)row inComponent:(NSInteger)component
{
if([[list objectAtIndex:[pickerView selectedRowInComponent:0]] isEqual: @"1 Gallon"] && [list2 objectAtIndex:[pickerView selectedRowInComponent:1] isEqual: @"Grams"])
output.text = @"1 GALLON GRAMS";
if([[list objectAtIndex:[pickerView selectedRowInComponent:0]] isEqual: @"2 Gallons"] && [list2 objectAtIndex:[pickerView selectedRowInComponent:1] isEqual: @"Ounces"])
output.text = @"2 GALLONS OUNCES";
}
但是总是报错: No visible @interface for 'NSMutableArray' declares the selector 'objectAtIndex:isequal'
如何比较两个返回的值?比如 IF comp(0) == 3 and comp(1) ==2, output 3.4。
多谢。