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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T06:34:32+00:00 2026-06-13T06:34:32+00:00

The Question is this : I have a view controller Controller 1 which is

  • 0

The Question is this :

I have a view controller Controller 1 which is a delegate of 2 other controllers Controller 2 and Controller 3.

Controller 2 has a delegate method called “FOO”, Controller 3 has the same method.

Can I implement one “FOO” method inside Controller 1 if both “FOO” methods tells the delegate to do the same exact thing ?

Thanks

Shani

  • 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-13T06:34:34+00:00Added an answer on June 13, 2026 at 6:34 am

    Good delegate design means methods shouldn’t have the same name. For example, if I have two classes called FooA and FooB, that both perform the delegating action foobar:(BOOL)force, then the delegate method names should be as follows:

    - (void)fooA:(FooA*)foo foobar:(BOOL)force;
    - (void)fooB:(FooB*)foo foobar:(BOOL)force;
    

    This way, your ‘Controller 1’ will be able to differentiate between the two delegate methods. You will notice this in other delegates, for example UITableView:

    - (BOOL)tableView:(UITableView *)tableView shouldHighlightRowAtIndexPath:(NSIndexPath *)indexPath
    

    You’re able to differentiate if shouldHighlightRowAtIndexPath originated from a UITableView or a different class.

    Saying this, it is entirely possible to have a single method name shared between two delegates, it’s just the delegate won’t be sure of the source of the delegation.

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

Sidebar

Related Questions

Newbee question here - I have this method in the view controller m: -(void)
I want to implement this view But I have one question: The text which
I have this view (DetailsContainer, first class in code section of this question) with
I have this question in which I have a SQL Server Compact Edition database
I have this question: How could I call a codebehind method from jquery? I
This is more of a design question. I have a single ViewController which manages
I have a question regarding uitable view. I am implementing an app which is
I have my MainViewController which a UIViewController class, in this view I have a
@Jonah pointed me to the following explanation he has provided: Question on View Controller's
I have made a question which is a bit similar to this, though the

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.