2012-05-14 74 views
0

選擇特定的值我正在開發一個application.In使用帶有10 values.Whenever我滾動選擇器上下選擇器認爲(IAM),拾取彎腰最後的值將被選中後並沒有selectrow將被解僱但我不想那個,我需要選擇我想要選擇哪一個。所以請告訴我如何做那一個。如何從UIpickerView

回答

0

UIPickerViewDelegate方法,讓你選定行:

-(void)pickerView:(UIPickerView *)pickerView didSelectRow:(NSInteger)row 
inComponent:(NSInteger)component 
{ 
     float rate = [[exchangeRates objectAtIndex:row] floatValue]; 
     float dollars = [dollarText.text floatValue]; 
     float result = dollars * rate; 

     NSString *resultString = [[NSString alloc] initWithFormat: 
     @"%.2f USD = %.2f %@", dollars, result, 
       [countryNames objectAtIndex:row]]; 
     resultLabel.text = resultString; 
} 

這可能是你的問題正確的鏈路Click here

+0

可能是你無法我已瞭解我question.If滾動選擇器,然後上面的方法將被解僱,並挑選一個value.But我不需要那個one.And我不需要那個自動值選擇。 – user1381821