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 6657017
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T01:42:53+00:00 2026-05-26T01:42:53+00:00

In short, the following code calls an existing selector in the super class, and

  • 0

In short, the following code calls an existing selector in the super class, and then gives an NSInvalidException:

- (void)applicationWillResignActive:(UIApplication *)application {
if ([super respondsToSelector:@selector(applicationWillResignActive:)])
{
    [super applicationWillResignActive:application];
}

This gives the following log exception:

  • *** Terminating app due to uncaught exception ‘NSInvalidArgumentException’, reason: ‘-[aAppDelegate applicationDidEnterBackground:]: unrecognized selector sent to instance 0x5b5d360’

To elaborate… I have a base application delegate (from our new company library) declared as:

I have a base application delegate class, BaseAppDelegate. It is declared as:

@interface CoAppDelegate : NSObject <UIApplicationDelegate> 

It implements:

- (void)applicationDidBecomeActive:(UIApplication *)application
{
    DebugLog(@"*** ACTIVE ****");
}

It does not implement @selector(applicationWillResignActive:) – or at least what I mean is that I have not specifically written out code for that method. It can’t be found in the .h or .m file.

My app has an app delegate that inherits from CoAppDelegate as:

@interface aAppDelegate : CoAppDelegate <UIApplicationDelegate>

I implement both of the above methods as:

- (void)applicationWillResignActive:(UIApplication *)application {
    if ([super respondsToSelector:@selector(applicationWillResignActive:)])
    {
        [super applicationWillResignActive:application];
    }
}

- (void)applicationDidBecomeActive:(UIApplication *)application {
    if ([super respondsToSelector:@selector(applicationDidBecomeActive:)])
    {   
        [super applicationDidBecomeActive:application];
    }
}

When the app launches, I get the debug output “*** ACTIVE ****” – as it should.

When I send my app to the background I get that NSInvalidArgumentException stating that the responder does not exist – and it does not exist, so this is the correct exception to throw.

What I need to know is WHY does respondsToSelector give a YES when I am expecting to see a NO? What is the little subtle thing that I am missing?

  • 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-05-26T01:42:54+00:00Added an answer on May 26, 2026 at 1:42 am

    Instead of [super class] you should use [self superclass]:

    [[self superclass] instancesRespondToSelector:@selector(method)]
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following code snippet. public static void main(String[] args) { short a
Consider the following code: void f(byte x) {print(byte);} void f(short x) {print(short);} void f(int
Long story short Say I have the following code: // a class like this
I have the following code: class A { public: A() {}; void operator[](int x)
In short, currently I am using the following code to pull records from multiple
I'm folowing this tutorial to create php/jquery based chat application. In short, this code
Given the following C# class definitions and code: public class BaseClass { public virtual
Having sorted the tag_counts hash via the following code: sorted_tags = Contact.tag_counts.sort{ |x,y| x.name.downcase
I have code like following: switch(sort.Column) { case code: model = (sort.Direction == SortDirection.Ascending)
Consider the following short program: #include <type_traits> #include <iostream> using namespace std; template <typename

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.