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

  • SEARCH
  • Home
  • 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 6253509
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T14:00:37+00:00 2026-05-24T14:00:37+00:00

Why are warnings generated when calling methods undeclared in a class interface using conventional

  • 0

Why are warnings generated when calling methods undeclared in a class interface using conventional means, but not when calling methods using @selector? Is it because selectors can be executed by a different caller than self?

For example:

-(void) doStuff
{
    [self doNow]; // Warning: instance method not found
    SEL sel = @selector(doNow); // no warnings
}   

-(void) doNow {} // this method is not declared in the interface
  • 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-24T14:00:41+00:00Added an answer on May 24, 2026 at 2:00 pm

    The “Undeclared Selector” warning is turned off by default. I don’t know why. You can turn it back on in the Build Settings.

    The documentation for this settings reads:

    Warn if a “@selector(…)” expression referring to an undeclared selector is found. A selector is considered undeclared if no method with that name has been declared before the “@selector(…)” expression, either explicitly in an @interface or @protocol declaration, or implicitly in an @implementation section. This option always performs its checks as soon as a “@selector(…)” expression is found, while -Wselector only performs its checks in the final stage of compilation. This also enforces the coding style convention that methods and selectors must be declared before being used. [GCC_WARN_UNDECLARED_SELECTOR, -Wundeclared-selector]

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

Sidebar

Related Questions

The following code generates two CA2000 warnings (among others, but that's not the point).
I generated latex template using perl,and complied with MikTeX, its generating pdf. But I
What is the best way to disable the warnings generated via _CRT_SECURE_NO_DEPRECATE that allows
Recently, when porting some STL code to VS2008 I wanted to disable warnings generated
I like (bool) way more, but it generates warnings. How do i get rid
On a generated project I get 100s of warnings caused by unused imports and
Possible Duplicate: Why are C# collection-properties not flagged as obsolete when calling properties on
I've generated a self-signed certificate for my Java app using keytool. However, when I
the following is a script which was generated using generate script option. the wizard
I’m using g++ with warning level -Wall -Wextra and treating warnings as errors (

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.