Loading

Monday, June 14, 2010

Find The Index of Selected Row Of Picker View

- (void)pickerView:(UIPickerView *)pickerView didSelectRow:(NSInteger)row inComponent:(NSInteger)component
{
lbl.text = [arr_tmp objectAtIndex:[pickerView selectedRowInComponent:0]];
if([arr_tmp indexOfObject:[arr_tmp objectAtIndex:[pickerView selectedRowInComponent:0]]]==0)
{
// Statement of Condation if Index At 0
}
else if([arr_tmp indexOfObject:[arr_tmp objectAtIndex:[pickerView selectedRowInComponent:0]]]==1)
{
// Statement of Condation if Index At 1
}
else if([arr_tmp indexOfObject:[arr_tmp objectAtIndex:[pickerView selectedRowInComponent:0]]]==2)
{

// Statement of Condation if Index At 2
}
}

NOTE :- arr_tmp is the Array which's elements disply's in Picker View

No comments:

Post a Comment