How can I use a picker view to select something and while the picker view is 
still displayed, have it update multiple text fields?

Conceptual setup: I have a dictionary of values like {A:1, B:2, C:3}. The keys 
(text values) are what the user is going to pick from the list. The numeric 
values are the corresponding value. User picks value A, and then the number 1 
goes into another data field (numbers will actually be hard to remember floats).
I can successfully show a picker when user enters the text field for the text 
value. It updates the text field properly. I can "get" the numeric value from 
the dictionary, but how do I get that other text field to update when the user 
scrolls the picker list?

Currently I have my text field subclassed and it's the  
<UIPopoverControllerDelegate, UIPickerViewDataSource, UIPickerViewDelegate> for 
the picker. I'm using this to try to force updating of the 2nd (numeric) field 
as the picker is scrolled, but since the picker is in the foreground it's 
crashing, I figure since it won't let other messages through till it's 
dismissed. I don't want to wait till the picker is dismissed to display the 
value.

- (void)pickerView:(UIPickerView *)pickerView didSelectRow:(NSInteger)row 
inComponent:(NSInteger)component
{
    [selfsetText:[[[[PaxValueStoresharedStore] allPaxValues] allKeys] 
objectAtIndex:row]];
    NSNumber *thePax = [[[PaxValueStore sharedStore] allPaxValues] 
objectForKey:[self text]]; //returns nsnumber
    NSLog(@"%@", thePax); //this works fine until next
    [[self delegate] performSelector:@selector(setPaxFieldValue:)
                          withObject:thePax];
}

Thanks
Chris
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to