0
我試圖根據我的UIPickerView
中的第一個和第二個選擇輸出某個數字。我在這裏有這個代碼。無法比較我的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";
}
,但我一直沒有得到明顯@interface的錯誤NSMutableArray
宣佈選擇objectAtIndex:isequal
我應該如何比較一下兩個值返回?像IF comp(0) == 3 and comp(1) ==2
,輸出3.4到我的標籤。
完美!謝謝! – Intelwalk