2
我在UItableview中有一個文本框。用戶點擊文本字段,我想要一個UIpickerview從NSArray中彈出數據。我試圖實現這個,但應用程序崩潰。 請在下面找到我的代碼。對textField的UIPickerview點擊
- (NSString*)pickerView:(UIPickerView*)pv titleForRow:(NSInteger)row forComponent:(NSInteger)component
{
return [policyarraycount objectAtIndex:row];
}
- (NSInteger)numberOfComponentsInPickerView:(UIPickerView*)pv
{
return 1;
}
- (NSInteger)pickerView:(UIPickerView*)pv numberOfRowsInComponent:(NSInteger)component
{
return [policyarraycount count];
}
- (void)pickerView:(UIPickerView *)pv didSelectRow:(NSInteger)row inComponent:(NSInteger)component {
txtPolicy.text = (NSString *)[policyarraycount objectAtIndex:row];
}
請讓我知道我要去哪裏錯了。
感謝