Note that there are some explanatory texts on larger screens.

plurals
  1. POUISegmentedControl selector not working
    primarykey
    data
    text
    <p>I have a calls Called Modal that I am running the following code in.</p> <pre><code> - (void)createAccessoryView { CGRect frame = CGRectMake(0.0, self.frame.size.height, self.frame.size.width, 44.0); fieldAccessoryView = [[UIToolbar alloc] initWithFrame:frame]; fieldAccessoryView.barStyle = UIBarStyleBlackOpaque; fieldAccessoryView.tag = 200; [fieldAccessoryView setBarStyle:UIBarStyleBlack]; UIBarButtonItem *spaceButton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace target:nil action:nil]; UIBarButtonItem *doneButton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemDone target:self action:@selector(done:)]; UISegmentedControl* segmentedControl = [[UISegmentedControl alloc] initWithItems:[NSArray arrayWithObjects:NSLocalizedString(@"Previous", @""), NSLocalizedString(@"Next", @""), nil]]; [segmentedControl addTarget:self action:@selector(segmentAction:) forControlEvents:UIControlEventValueChanged]; segmentedControl.segmentedControlStyle = UISegmentedControlStyleBar; [segmentedControl setMomentary:YES]; UIBarButtonItem *segmentButton = [[UIBarButtonItem alloc] initWithCustomView:segmentedControl]; [fieldAccessoryView setItems:[NSArray arrayWithObjects:segmentButton, spaceButton, doneButton, nil] animated:NO]; } -(void)segmentAction:(id)selector { } </code></pre> <p>I then create a class that extends Modal and has a few UITextFields. Clicking on a text field brings up the keyboard as expected. Once the keyboard is launched I see the previous / next and done buttons. Clicking done throws and error and doesn't use the segmentAction method as it should. Not really sure why.</p> <p>here is the stack trace I get after clicking the done button</p> <pre><code>2013-03-13 15:54:33.956 myapp[74194:c07] -[NotesModal done:]: unrecognized selector sent to instance 0x80f3fb0 2013-03-13 15:54:33.961 myapp[74194:c07] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NotesModal done:]: unrecognized selector sent to instance 0x80f3fb0' *** First throw call stack: (0x1b54012 0x1470e7e 0x1bdf4bd 0x1b43bbc 0x1b4394e 0x1484705 0x3b82c0 0x5f4a64 0x1484705 0x3b82c0 0x3b8258 0x479021 0x47957f 0x4786e8 0x3e7cef 0x3e7f02 0x3c5d4a 0x3b7698 0x1aafdf9 0x1ad7f3f 0x1ad796f 0x1afa734 0x1af9f44 0x1af9e1b 0x1aae7e3 0x1aae668 0x3b4ffc 0x1786d 0x24b5) libc++abi.dylib: terminate called throwing an exception </code></pre>
    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