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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T17:54:32+00:00 2026-05-22T17:54:32+00:00

If I override a method in a category, will it just affect the files

  • 0

If I override a method in a category, will it just affect the files including it, or it affects the whole project?
I want to override “methodSignatureForSelector” and “forwardInvocation” to ignore the undefined selector error for NSNull. So I want to know if this affects just the files including it. Thanks in advance.

  • 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-22T17:54:33+00:00Added an answer on May 22, 2026 at 5:54 pm

    Say that you have a class A and a category C defined on it.
    Each of those classes has got its own .h .m files.

    What does the category “affect”?

    As to compilation, only the compilation units (.m files) that import the C.h file. Say: in files that import that header, you will not have warnings about undefined selectors (for selectors defined in C.h, of course); in the other files, you will get such warnings.

    As to linking (or executing, which is pretty close in Objective-C), all of your executable is affected.

    Indeed, even if you don’t import the C.h file in, say, B.m, if B.m uses a selector defined in C.h, that call will succeed (i.e., the implementation from your category will be effectively used), but you will get nonetheless a warning when compiling B.m. This will also hold true if B.m was compiled at a different time (i.e, before creating the category).

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

Sidebar

Related Questions

I want to override the SubmitChanges() method for my model. Whern I try to
I want to override the Tostring() method for changing some characters. Is it possible?
On a past project (pre-iOS 4.0), I wrote the following category method on NSSortDescriptor
I am trying to override a UIStoryboard method using a category. Here is my
In Objective-C, if I override a class method using a category, is there a
Can you override method in java without using annotations? Because eclipse doesn't support it
I have implemented a ToString() override method for my class in my Webservice and
It is possible in plain Java to override a method of a class programmatically
I have a class MyClass, and I would like to override the method ToString()
How do I override the __getattr__ method of a class without breaking the default

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.