我有一个使用我想要的值的 iOS UiPicker,并且可以使用以下代码检测何时选择了新选项:
- (void)pickerView:(UIPickerView *)pickerView didSelectRow:(NSInteger)row inComponent:(NSInteger)component {
NSString *aCompany = [arrayColour objectAtIndex:[pickerView selectedRowInComponent:0]];
UIAlertView *alert = [[UIAlertView alloc]
initWithTitle:@"Picked:"
message:aCompany
delegate:nil
cancelButtonTitle:@"Okay"
otherButtonTitles:nil];
[alert show];
}
我的问题是如何在按下这样的按钮后从选择器中获取最新信息:
- (IBAction)DoneButton:(id)sender {
UIAlertView *alert = [[UIAlertView alloc]
initWithTitle:@"Picked:"
message:aCompany
delegate:nil
cancelButtonTitle:@"Okay"
otherButtonTitles:nil];
[alert show];
}