Note that there are some explanatory texts on larger screens.

plurals
  1. PO-[PickerViewController superview]: unrecognized selector sent to instance & TableView ->ViewController w/ Picker View
    primarykey
    data
    text
    <p>I am a novice ios programmer having some trouble push segueing from a custom UITableViewController scene to a custom UIViewController scene which contains a Picker View and implements the @required pickerview delegate/datasource methods.</p> <p>[I had a screenshot here to offer more insight but I dont have the rep to post images. Imagine a tableview controller with three static rows, each offering a detail disclosure to push to the respective picker view - <a href="http://imgur.com/0oIo0Zr" rel="nofollow">Image</a>]</p> <p>The issue happens at runtime when I tap on any of the table's disclosure indicators. The error returned is </p> <pre><code>Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[PickerViewController superview]: unrecognized selector sent to instance." </code></pre> <p>As mentioned, LocationFilter subclasses UITableViewController and consists of just a few properties for the labels and the stepper.</p> <p>The code for my picker view controller is as follows:</p> <pre><code>#import &lt;UIKit/UIKit.h&gt; @interface PickerViewController : UIViewController &lt;UIPickerViewDataSource,UIPickerViewDelegate&gt; { NSArray *sectionCandidates; NSArray *bankCandidates; NSArray *positionCandidates; } @property (weak, nonatomic) IBOutlet UIPickerView *sectionPicker; @property (weak, nonatomic) IBOutlet UIPickerView *bankPicker; @property (weak, nonatomic) IBOutlet UIPickerView *positionPicker; @property NSArray *sectionCandidates, *bankCandidates, *positionCandidates; @end </code></pre> <p>and the .m:</p> <pre><code>#import "PickerViewController.h" #import "SlotMachine.h" @implementation PickerViewController @synthesize sectionCandidates, sectionPicker, bankCandidates, bankPicker, positionCandidates, positionPicker; - (void)viewDidLoad { [super viewDidLoad]; sectionCandidates = [NSArray arrayWithObjects:@"A", @"B", @"C", @"D", @"E", @"F", @"G", @"H", @"I", nil]; bankCandidates = [NSArray arrayWithObjects:@"0", @"1", @"2", @"3", @"4", @"5", @"6", @"7", @"8", nil]; positionCandidates = [NSArray arrayWithObjects:@"0", @"1", @"2", @"3", @"4", @"5", @"6", nil]; } // returns the number of 'columns' to display. - (NSInteger)numberOfComponentsInPickerView:(UIPickerView *)pickerView { return 1; } - (void)pickerView:(UIPickerView *)pickerView didSelectRow:(NSInteger)row inComponent:(NSInteger)component { //Handle Selection } // returns the # of rows in each component.. - (NSInteger)pickerView:(UIPickerView *)pickerView numberOfRowsInComponent:(NSInteger)component { switch ([pickerView tag]) { case 0: return [sectionCandidates count]; case 1: return [bankCandidates count]; case 2: return [positionCandidates count]; default: return 0; } } // returns the label for each row -(NSString *)pickerView:(UIPickerView *)pickerView titleForRow:(NSInteger)row forComponent:(NSInteger)component { switch ([pickerView tag]) { case 0: return [sectionCandidates objectAtIndex:row]; case 1: return [bankCandidates objectAtIndex:row]; case 2: return [positionCandidates objectAtIndex:row]; default: return @"Null"; } } @end </code></pre> <p>Unfortunately picker views don't seem to get much detailed attention in terms of troubleshooting so I have not been able to find much on SO or in some iOS books that I've been going through to help me resolve this problem. I have a general idea of the possible causes for 'unrecognized selector sent to instance' but am not sure how the fixes for that apply here. I appreciate in advance any help I might receive and also apologize if I did not format properly or give enough/relevant information as this is my first post!</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload