Search Results

Search found 2 results on 1 pages for 'chimgrrl'.

Page 1/1 | 1 

  • delegate method throws runtime "unrecognized selector" error when switching back from one UIViewCont

    - by chimgrrl
    Ok, I've spend like half day on this and it's killing me. So I've got 3 view controllers transitioning from one another, something like this: I call the UploadDecisionViewController after destroying the previous View Controller: [self dismissModalViewControllerAnimated:YES]; [self performSelector:@selector(showUDModalView) withObject:nil afterDelay:0.5]; In my showUDModalView method: - (void)showUDModalView { UploadDecisionViewController *udcontroller = [[UploadDecisionViewController alloc] initWithNibName:@"UploadDecisionViewController" bundle:nil]; udcontroller.delegate = self; [self presentModalViewController:udcontroller animated:YES]; [udcontroller release]; } 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: Inside UploadDecisionDelegate protocol (UploadDecisionViewController.h): @protocol UploadDecisionDelegate //let UOnliveViewController know that a button was selected - (void)UploadDecisionViewController:(UploadDecisionViewController *)controller madeChoice:(NSString *)whichDirection; @end Then inside my IBAction method when the button is clicked, I have this: - (IBAction)decisionSelected:(id)sender { [delegate UploadDecisionViewController:self madeChoice:@"upload"];//crashing at this line } When I run this, at this line above it is throwing a runtime exception: 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 ) Let me throw in the delegate method implemented also: - (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]; } } Can someone tell me what the heck is going on? Thanks a bunch for the help...

    Read the article

  • dismissing uiwebview

    - by chimgrrl
    Ok, I really spend 2 days on this and it has gotten me stumped. From my main UIViewController I called a WebViewController which is a UIViewController with a UIWebView inside: UOLCategoriesWebViewController *ucwvcontroller = [[UOLCategoriesWebViewController alloc] initWithNibName:@"UOLCategoriesWebViewController" bundle:nil]; [self presentModalViewController:ucwvcontroller animated:YES]; [ucwvcontroller release]; Inside the UOLCategoriesWebViewController I've call the delegate method shouldStartLoadWithRequest where when the user clicks on a particular type of link it parses out the params and return back to the main UIViewController (or at least that's what I want it to do): - (BOOL)webView:(UIWebView*)webView shouldStartLoadWithRequest:(NSURLRequest*)request navigationType:(UIWebViewNavigationType)navigationType { BOOL continueOrExit = YES; NSURL *url = request.URL; NSString *urlString = [url relativeString]; NSString *urlParams = [url query]; NSArray *urlParamArr = [urlParams componentsSeparatedByString:@"&"]; NSLog(@"the url is: %@",urlString); //NSLog(@"the params are: %@,%@",[urlParamArr objectAtIndex:0],[urlParamArr objectAtIndex:1]); //BOOL endTrain1 = [[urlParamArr objectAtIndex:1] hasPrefix:@"subCatValue"]; //BOOL endTrain2 = ([urlParamArr objectAtIndex:1 //NSLog(@"Number of elements: %@",[urlParamArr count]); if (navigationType == UIWebViewNavigationTypeLinkClicked) { //NSLog(@"Enter into His glory"); if ([urlString hasSuffix:@"categories_list.php"]) { //NSLog(@"2nd Heaven"); continueOrExit = YES; }else if ([[urlParamArr objectAtIndex:1] hasPrefix:@"subCatValue"]) { continueOrExit = NO; NSLog(@"end of the train"); NSArray *firstParamStringArr = [[urlParamArr objectAtIndex:0] componentsSeparatedByString:@"="]; NSArray *secondParamStringArr = [[urlParamArr objectAtIndex:1] componentsSeparatedByString:@"="]; NSString *catSelected = [firstParamStringArr objectAtIndex:1]; NSString *subCatSelected = [secondParamStringArr objectAtIndex:1]; //go back to native app [self goBackToMain:catSelected andSubCat:subCatSelected]; } } return continueOrExit; } Actually in the above function where I am calling the goBackToMain method I want it to call the delegate method and return to the mainviewcontroller. Unfortunately after executing that goBackToMain method it goes back to this method and continue to return continueOrExit. Is there anyway to make it truly exit without returning anything? I've tried putting in multiple returns to no avail. Or can I in the html page pass some javascript to directly call this method so that I don't have to go through this delegate method? Thanks for the help in advance!

    Read the article

1