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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T15:41:45+00:00 2026-06-07T15:41:45+00:00

There seems to be some debate/disagreement on whether it is possible to ‘overload’ methods

  • 0

There seems to be some debate/disagreement on whether it is possible to ‘overload’ methods in Objective-C. Putting aside that it is impossible to define method overloading in Objective-C is terms equal to those of C++ (because of method signature syntax differences), I would ask in particular: Which of the following is allowed and which are not?

1) A class declaring/implementing both these methods:

- (void) doSomethingWithObject:(ClassA*) object;
- (void) doSomethingWithObject:(ClassB*) object;

2) A class declaring/implementing both these methods:

- (void) doSomethingWithObject:(ClassA*) object;
- (BOOL) doSomethingWithObject:(ClassA*) object;

3) A class declaring/implementing this method:

- (void) doSomethingWithObject:(ClassB*) object;

…when its superclass declares/implements this method:

- (void) doSomethingWithObject:(ClassA*) object;

(and the analogue for conflicting return value), both when A) ClassB descends from ClassA, and B) Not.

  • 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-07T15:41:47+00:00Added an answer on June 7, 2026 at 3:41 pm

    Question 1: no can do: Objective-C doesn’t include the types in the method names; there is no mangling. It might work with Objective-C++ — never used it that much.

    Question 2: Same. Won’t work.

    Question 3: Will work.

    EDIT: in general, method names do not include any types, so if you strip the types and they are the same then it will be considered the same, and therefore won’t be allowed in the same class. Along the same lines, it WILL work if it’s in different classes, although you might get some confusion if the types used in the call and the types used in what gets called don’t quite agree.

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

Sidebar

Related Questions

There seems to be some debate about whether JPEGs with alpha channels are valid
There seems to be some debate over refactoring to utilize java generics within my
There seems to be some controversy on whether the number of jobs in GNU
I want to test the phpDocumentor-alpha, and there's a problem that some people seems
Is there some valid purpose to minifying before compressing? It seems highly unlikely that
There seems to be some uncertainty about the terminology that should be used. There
There seems to be some people that have gotten Paperclip working on a regular
There seems to be some limit on the size of group titles that you
I have a survey on a website, and there seems to be some issues
(see attached jsfiddle, screenshots; running browsers on Ubuntu 11.10) There seems to be some

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.