2011-05-26 59 views
0

我在我的應用程序中使用UIpickerview。問題是我的pickerview titleforrow函數總是返回3行,儘管numberofRowsinComponent返回更多行。行爲pickerview titleForRow總是從2開始

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

return [filteredTerms count]; } 


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


CreateOrder *order = [filteredTerms objectAtIndex:row]; 

NSString *title; 
title = order.kBranchName; 

return title; } 

我甚至試圖硬編碼返回的數字或行,但它不工作。該titleforrow行始終從2

+0

你怎麼知道它開始2? – 2011-05-26 11:13:45

回答

2

試試這個

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

return [filteredTerms objectAtIndex:row]; 

} 
相關問題