Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8617789
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T05:57:00+00:00 2026-06-12T05:57:00+00:00

Using Cordova 2.1.0 for IOS app development. I have following as my shouldStartLoadWithRequest function

  • 0

Using Cordova 2.1.0 for IOS app development.
I have following as my shouldStartLoadWithRequest function in MainViewController.m file:

- (BOOL)webView:(UIWebView *)webView2 
shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType {

    NSLog(@"shouldStartLoadWithRequest function");

    // Intercept custom location change, URL begins with "js-call:"
    if ([[[request URL] absoluteString] hasPrefix:@"js-call:"]) {

        // Call the given selector
        [self performSelector:NSSelectorFromString(@"resetBadgeCount")];

        // Cancel the location change
        return NO;
    }

    // Accept this location change
    return YES;

}

The thing is, in my index.html i have following:-
window.location = “js-call:resetBadgeCount”;

But resetBadgeCount is a function existing in AppDelegate.m file and whenever shouldStartLoadWithRequest function is called, it gives this error:

-[MainViewController resetBadgeCount]: unrecognized selector sent to instance 0x199db0

So how should i change the code such that error suppresses and resetBadgeCount function is successfully invoked.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T05:57:02+00:00Added an answer on June 12, 2026 at 5:57 am

    At the moment you’re telling the MainViewController to try performing the selector. That’s why it’s saying:

    -[MainViewController resetBadgeCount]: unrecognized selector…

    Try changing [self performSelector:…] to [[[UIApplication sharedApplication] delegate] performSelector:…]

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using cordova 2.1.0 for my IOS app development. I connected my IOS
I'm using Cordova 1.9.0 for an Android App. The same code, on IOS works
I am building an app in xcode using the Cordova/phonegap framework for ios which
I'm using Phonegap (Cordova) v1.9, and this app is solely for iPhone4+ use. I've
I am trying to write a file in android using phonegap cordova 1.5.0. Below
I've to develop a simple Android app using the Cordova API(PhoneGap) and it requires
I'm building an hybrid Android App using Phonegap/Apache Cordova. My app should get data
I am using JQM 1.1.0 and Cordova 1.5.0. I have code like this <!DOCTYPE
I have a problem with the phonegap version 1.7.0rc1 and the development under iOS
I'm trying to work with files on IOS, using Phonegap[cordova 1.7.0]. I read how

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.