Note that there are some explanatory texts on larger screens.

plurals
  1. POdelegate method throws runtime "unrecognized selector" error when switching back from one UIViewController to the main View Controller
    primarykey
    data
    text
    <p>Ok, I've spend like half day on this and it's killing me.</p> <p>So I've got 3 view controllers transitioning from one another, something like this:</p> <p>I call the UploadDecisionViewController after destroying the previous View Controller:</p> <pre><code>[self dismissModalViewControllerAnimated:YES]; [self performSelector:@selector(showUDModalView) withObject:nil afterDelay:0.5]; </code></pre> <p>In my showUDModalView method:</p> <pre><code>- (void)showUDModalView { UploadDecisionViewController *udcontroller = [[UploadDecisionViewController alloc] initWithNibName:@"UploadDecisionViewController" bundle:nil]; udcontroller.delegate = self; [self presentModalViewController:udcontroller animated:YES]; [udcontroller release]; } </code></pre> <p>The UploadDecisionViewController shows up no problem. The UploadDecisionViewController has a button, which when clicked I want it to transition to the FileUploadViewController. I setup a UploadDecisionDelegate, threw a method in there to handle the button clicking:</p> <p>Inside UploadDecisionDelegate protocol (UploadDecisionViewController.h):</p> <pre><code>@protocol UploadDecisionDelegate //let UOnliveViewController know that a button was selected - (void)UploadDecisionViewController:(UploadDecisionViewController *)controller madeChoice:(NSString *)whichDirection; @end </code></pre> <p>Then inside my IBAction method when the button is clicked, I have this:</p> <pre><code>- (IBAction)decisionSelected:(id)sender { [delegate UploadDecisionViewController:self madeChoice:@"upload"];//crashing at this line } </code></pre> <p>When I run this, at this line above it is throwing a runtime exception:</p> <pre><code>2010-06-09 12:48:59.561 UOnlive[4735:207] *** -[UIView UploadDecisionViewController:madeChoice:]: unrecognized selector sent to instance 0x3b65420 2010-06-09 12:48:59.562 UOnlive[4735:207] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[UIView UploadDecisionViewController:madeChoice:]: unrecognized selector sent to instance 0x3b65420' 2010-06-09 12:48:59.563 UOnlive[4735:207] Stack: ( 33502299, 2495698185, 33884219, 33453686, 33306306, 20618, 2982917, 3390286, 3399023, 3394235, 3087839, 2996168, 3022945, 40156505, 33287040, 33283144, 40150549, 40150746, 3026863, 11700, 11554 ) </code></pre> <p>Let me throw in the delegate method implemented also:</p> <pre><code>- (void)UploadDecisionViewController:(UploadDecisionViewController *)controller madeChoice:(NSString *)whichDirection { NSLog(@"it got to here 245"); [self dismissModalViewControllerAnimated:YES]; if (yesOrNo) { //open up the FileUploadViewController and proceed to upload [self performSelector:@selector(showFUModalView) withObject:nil afterDelay:0.5]; } } </code></pre> <p>Can someone tell me what the heck is going on? Thanks a bunch for the help...</p>
    singulars
    1. This table or related slice is empty.
    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.
    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