in Education by
I want to use UIPickerView with 2 components, in which the second component value will be dependent on the first component value, like if in the first component Group 1 is selected then in the second component the group 1 values should be shown. After selecting the values from both components value will be assigned to a UITextField or UILabel and the picker will be hidden. (I have a main view in which I have added a subview to add the UIPickerView). -(NSInteger)numberOfComponentsInPickerView:(UIPickerView *)pickerView { return 2; } -(NSInteger)pickerView:(UIPickerView *)pickerView numberOfRowsInComponent:(NSInteger)component { if (component==0) { return [vGroup count]; } else { return [vehiclePickerList count]; } } -(NSString *)pickerView:(UIPickerView *)pickerView titleForRow:(NSInteger)row forComponent:(NSInteger)component { switch (component) { case 0: return [vGroup objectAtIndex:row]; break; case 1: return [vehiclePickerList objectAtIndex:row]; break; } return nil; } JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)

1 Answer

0 votes
by
Please provide some code what you have written. For component-related issues, use - (NSInteger)numberOfComponentsInPickerView:(UIPickerView *)pickerView. Store corresponding values (which you want to show in component 2) of each row of component 1 in an array of dictionary, and load values from there.

Related questions

0 votes
    I have custom view: #import @interface materialView : UIView { IBOutlet UIImageView * _img; IBOutlet UILabel * ... for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 13, 2022 in Education by JackTerrance
0 votes
    The principal components are equal to left singular values if you first scale the variables. (a) True (b ... and answers pdf, Data Science interview questions for beginners...
asked Oct 28, 2021 in Education by JackTerrance
0 votes
    I have 2 JMS queues and my application subscribes to both of them with Jms.messageDrivenChannelAdapter(...) ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 30, 2022 in Education by JackTerrance
0 votes
    what is the role of following components of a computer system (1) control unit (2) arithmetic logic unit ( ... (5) motherboard Select the correct answer from above options...
asked Nov 28, 2021 in Education by JackTerrance
0 votes
    Difference between: 1. Biotic components and Abiotic component 2. Producers and Herbivores 3. Carnivores ... proposed by,electromagnetic theory engineering physics,Science nptel...
asked Nov 7, 2021 in Education by JackTerrance
0 votes
    Suppose you have three Jobs of which Jobs 1 and 2 are executed parallelly. Job 3 executes only after Jobs 1 and ... can be used to set this up? tUnite tPostJob tRunJob tParallelize...
asked Mar 24, 2021 in Technology by JackTerrance
0 votes
    The 2 components of CQRS include_______________ (a)Query & command side (b)Query & Client side (c)Server & command side (d)Server & client side...
asked Oct 21, 2020 in Technology by Editorial Staff
0 votes
    What does it mean by message blocking is active on iphone?...
asked Aug 6, 2022 in Technology by Editorial Staff
0 votes
    can anyone help me.. [NSString stringWithFormat:@"document.getElementsByTagName('body')[0].style.textAlign = ... for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jul 30, 2022 in Education by JackTerrance
0 votes
    I have designed a xib whose configuration I have set as shown in the pic I have added a UIImageView ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jul 11, 2022 in Education by JackTerrance
0 votes
    I have designed a xib whose configuration I have set as shown in the pic I have added a UIImageView ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jul 8, 2022 in Education by JackTerrance
0 votes
    I have designed a xib whose configuration I have set as shown in the pic I have added a UIImageView ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jun 14, 2022 in Education by JackTerrance
0 votes
    I would like to ask if I require a Mac for the entire process of the iPhone app development or ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 26, 2022 in Education by JackTerrance
0 votes
    Video does not capture in the right orientation when running the Camera Plugin example app on my iPhone X in Landscape. It works well ... .0+1 environment: sdk: ">=2.0.0-dev.68.0...
asked Apr 12, 2022 in Education by JackTerrance
0 votes
    I'm writing an iPhone app with Cocoa in xcode. I can't find any tutorials or sample code that ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 19, 2022 in Education by JackTerrance
...