我正在将位置信息解析为NSMutableArray
被调用的项目。我填写UIPickerView
如下:
- (NSInteger)numberOfComponentsInPickerView:(UIPickerView *)thePickerView {
return 1;
}
- (NSInteger)pickerView:(UIPickerView *)thePickerView numberOfRowsInComponent:(NSInteger)component {
return [items count];
}
- (NSString *)pickerView:(UIPickerView *)thePickerView titleForRow:(NSInteger)row forComponent:(NSInteger)component {
return [items objectAtIndex:row];
}
-(void)pickerView:(UIPickerView *)pickerView didSelectRow:(NSInteger)row
inComponent:(NSInteger)component
{
id item = [items objectAtIndex:row];
NSString *occasion = [item objectForKey:@"name"];
location.text = occasion;
}
当我这样做时,UIPickerView 中没有出现任何值,有人可以帮我解决这个问题吗?一切都正确连接