2011-07-11 150 views
0

我正在創建一個單位轉換器應用程序使用三個組件和plist的pickerview。第一個組件是類別組件,其餘的是單元組件。我需要的是當我在類別組件中選擇一個項目時,剩下的兩個組件應該得到關於該特定組件的值。爲了這個工作,我需要如何採取plist?有人能幫助我嗎?UIPickerView for iPhone

+0

什麼你的意思 「對於這個工作我如何需要採取的plist?」。 – dasdom

回答

0

我不明白你的意思了的plist什麼......但是:

對於其他兩個值的上下文相關介紹,你應該看看到的UIPickerViewDelegatepickerView:didSelectRow:inComponent:。在那裏你可以對第一個組件中的值的變化做出反應。

+0

好吧怎麼樣的方法來顯示組件中的值?請詳細幫助我 – Harsha

1

首先你的問題。是不是很清楚,我的意思是,你使用webservice獲取數據還是......? plist..it沒有必要


所有的東西,你可以使用委託方法,例如,

1)

-(NSInteger)numberOfComponentsInPickerView:(UIPickerView *)pickerView 

{ 

} 

告訴ü要多少分量add.like類別/ 1單元/ UNIT2/bla..bla ... BLA

2)

-(NSInteger)pickerView:(UIPickerView *)pickerView numberOfRowsInComponent:(NSInteger) component 

{ 

} 

告訴你如何處理行。

3)

-(NSString *)pickerView:(UIPickerView *)pickerView titleForRow:(NSInteger)row forComponent:(NSInteger)component 

{ 

} 

完蛋了