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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T11:41:32+00:00 2026-05-23T11:41:32+00:00

I am implementing a simple Twitter Client as a learning example. My controller implements

  • 0

I am implementing a simple Twitter Client as a learning example.

My controller implements NSXMLParserDelegate with custom implementations for a series of events/callbacks. Likewise, I implement a series of callbacks for the NSURLConnection. What I don’t understand is why the former is a delegate and the latter is not. It feels like both are event handler classes and could easily both be delegates. I have read the best practices on msdn and would think that both would be implemented as delegates. What am I missing here? Does it really matter?

 @interface SimpleTwitterClientViewController : UIViewController <NSXMLParserDelegate> {

     // Event handlers/callbacks for NSXMLParser Delegate
     - (void)parserDidStartDocument:(NSXMLParser *)parser;
     - (void)parser:(NSXMLParser *)parser didStartElement:(NSString *)elementName
    namespaceURI:(NSString *)namespaceURI
    qualifiedName:(NSString *)qualifiedName
    attributes:(NSDictionary *)attributeDict;
     - (void)parser:(NSXMLParser *)parser didEndElement:(NSString *)elementName
    namespaceURI:(NSString *)namespaceURI
    qualifiedName:(NSString *)qName;
     - (void)parser:(NSXMLParser *)parser foundCharacters:(NSString *)string;
     - (void)parserDidEndDocument:(NSXMLParser *)parser;

     // Event handlers/callbacks for URL Connection
     - (void) connection:(NSURLConnection *)connection didReceiveData:(NSData *)data;
     - (void) connection:(NSURLConnection *)connection didFailWithError: (NSError *)error;
     - (void) connectionDidFinishLoading: (NSURLConnection*) connection;
}
  • 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-23T11:41:33+00:00Added an answer on May 23, 2026 at 11:41 am

    Both are implemented as delegates. You’re looking at the code and guessing what it is by the name instead of reading the Apple documentation. When you see <SomeNameHere>, that is a protocol. The delegate conforms to it, which is why the protocol is named SomethingDelegate. It’s not called that because it’s a delegate.

    NSURLConnection uses an informal protocol for its delegate rather than a formal one. All this really means is that the system takes your word for it when you use an object as a delegate rather than checking for itself that you implement the relevant methods. I’m not aware of any particular reason why this is the case. It’s better to use formal protocols when you implement delegate systems yourself, but it’s not necessary.

    Don’t bother reading any documentation on MSDN. That is for C#, not Objective C. Read the documentation on Apple’s developer center.

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

Sidebar

Related Questions

I'm implementing a simple twitter client for the iPhone using a UITableView. I fetch
What's my best bet for implementing a simple chat client (2-person) in an ASP.NET
I have tried to find out the working solution for implementing simple events booking
I am implementing the simple JNI example , as given in http://java.sun.com/docs/books/jni/html/start.html At the
Hello everyone I'm currently implementing a simple programming language for learning experience but I'm
I'm implementing a simple TCP client and TCP server in Java at the moment,
I am implementing a simple directory listing script in PHP. I want to ensure
I'm implementing a simple Graph library for my uni project and since this is
I'm implementing a simple update mechanism for an application I'm writing the last part
I am implementing a simple version of a linux shell in c. I have

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.