我正在尝试根据我的第一个和第二个选择输出某个数字UIPickerView
。我这里有这段代码。
-(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
Declarations the selectors的错误objectAtIndex:isequal
我应该如何比较这两个值返回的内容?像IF comp(0) == 3 and comp(1) ==2
,输出 3.4 到我的标签。