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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T13:45:23+00:00 2026-05-30T13:45:23+00:00

Like in a sample code for XML parsing I encountered a comment: NSXMLParser *xmlParser

  • 0

Like in a sample code for XML parsing I encountered a comment:

NSXMLParser *xmlParser = [[NSXMLParser alloc] initWithContentsOfURL:url];

//Initialize the delegate.
XMLParser *parser = [[XMLParser alloc] initXMLParser];

//Set delegate
[xmlParser setDelegate:parser];

Can somebody tell me the difference between protocol’s delegate method and delegate in general?

  • 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-30T13:45:25+00:00Added an answer on May 30, 2026 at 1:45 pm

    A protocol is like an interface. If you come from JAVA or C# you have already seen this in action. It’s just a list of methods without implementation. A class can (or not) conforms to a specific protocol. A class has to implement methods that are marked as required. Those that are optionals could not be implemented.

    Delegation, instead, is a pattern that creates a relationships between two different objects. One of them, say A, is assisted by the second, say B. In other words, B does something for A.

    The relationships between the two is that delegate methods (for a specific class) are listed in protocols. Here the term delegate protocol.

    Why delegation is important? At some point of your application lifecyle, if a class send a message to its delegate (this it is not nil) and it has implemented a specific method (it can respond to that selector), the message is received by its delegate. At this point the control is captured by the delegate that performs some calculation and maybe can return some result.

    Hope it helps.

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

Sidebar

Related Questions

I am using something like the above sample code but when i try to
I'm using SS 2005 if that I've seen sample code like DECLARE @restore =
I would like a code sample for a function that takes a tDateTime and
I'm looking for pseudocode, or sample code, to convert higher bit ascii characters (like,
I am new to iPhone development. I am parsing a XML URL and display
I have an XML document with some sample content like this: <someTag> <![CDATA[Hello World]]>
Authorize.net provides some sample code for using CIM with ruby but its uses XML.
I am using SaxParser for parsing a XML which contains some image url which
I need to create an XML xPath parser. All parsing has to happen on
I'm studying Apple's LazyTableImages sample code. I'd like to understand how the app is

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.