sicKo
sicKo

Reputation: 1256

Row for pickerview titleForRow always start from 2

I'm using UIpickerview in my app. The problem is that my pickerview titleforrow function always return 3 rows although numberofRowsinComponent return more rows.

- (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;   }   

I've even tried to hard code the number or rows returned, but it is not working. The titleforrow row always start from 2.

Upvotes: 0

Views: 444

Answers (1)

Aman Aggarwal
Aman Aggarwal

Reputation: 3754

Try this

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

return [filteredTerms objectAtIndex:row];

 }

Upvotes: 2

Related Questions