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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T09:35:32+00:00 2026-05-30T09:35:32+00:00

Essentially what I’m asking is, what is a delegate, but also HOW EXACTLY do

  • 0

Essentially what I’m asking is, what is a delegate, but also HOW EXACTLY do I use one?

What is the flow of logic with delegates? I need things to be explained well and so for my many many google searches and searches on this site have revealed what they’re for, but not really how to use them.

I have a class that has a delegate in, and a function you can call asks for a delegate as an argument. What am I supposed to do, construct a duplicate delegate in my class, pass it through and then they’re linked? Some really basic explanation for dumb people would be much appreciated!

Thank you!

  • 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-30T09:35:33+00:00Added an answer on May 30, 2026 at 9:35 am

    Basically delegates are variables of type id that are say “coupled” with a Protocol which is pretty much like a Java or C# interface except for the fact that protocols may specify optional methods that you do not have to implement.

    So in order to use one the class that will be the delegate implements the protocol like this:

    .h file:
    
    MyClass <TheProtocol>
    
    .m file
    
    - (void)theMethodToImplement
    {
     //The implementation
    }
    

    After that the class that has the delegate variable just has to be set usually like this:

    theDelegateClass.delegate = self; 
    

    After that the “delegate class” may call the implemented methods on the other class like this:

    [delegate theMethodToImplement];
    

    You can do this safely for any methods that are not below the keyword @optional, for methods in the protocol declared below the keyword @optional, you should first check if the delegate decided or not to implement the method like this:

    if ([delegate respondsToSelector:@selector(theOptionalMethod)])
    [delegate theOptionalMethod];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Essentially I need to do something like this.... this is just an example... but
Essentially I need a count of each Entries Comments: SELECT e.*, COUNT(c.id) as comments
Essentially, I need to parse the response string of the CHAT CREATE command with
Essentially what I want to do is select the most recent message between one
Essentially I would like to apply a bottom-border , but rather than being in
Essentially need to read the dependencies programmatically without loading the assembly itself, as then
Essentially I need a JS Regexp to pop off the last part of a
Essentially, I need to know how to make a UIWebView erase everything when you
Essentially, I'm trying to achieve the affect of text-align:justify but with floating block elements.
Essentially I want to take a list of things like... a 345 b 762

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.