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

The Archive Base Latest Questions

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

I currently have NSXMLParser working in my viewcontroller. I would like to create a

  • 0

I currently have NSXMLParser working in my viewcontroller. I would like to create a new class that will have the 2 data elements as properties and do all of the xmlparsing. The problem I have is getting the new class to “alert” the parent when it is done parsing, etc. So the viewcontroller (the parent) can then turn off the activity indicator and then update the view with the information. like

[myParent jobCompleted];

How do I reference the parent that initialized the object. Can I setup a custom notification for that class so I can create an observer to monitor it?

  • 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-12T11:32:42+00:00Added an answer on May 12, 2026 at 11:32 am

    In lack of more info I’m going to assume somethings about your implementation..

    So I guess you have a delegate (which implements the NSXMLParserDelegate Protocol) for your NSXMLParser doing all the parsing.. Right?

    So the delegate protocol specifies a method called:

    - (void)parserDidEndDocument:(NSXMLParser *)parser
    

    If you implement that in your delegate you will know when the document has been parsed. So now you need to tell your viewcontroller about this event. Basically there are two ways of doing this. Either you make a “hard” connection between the NSXMLParserDelegate and your viewcontroller. This is basically done by specifying a property for that particular viewcontroller and setting that property to point to the viewcontroller when you’ve allocated the NSXMLParserDelegate object.
    And then you will be able to send a message to the “parent” in the parserDidEndDocument delegate method

    - (void)parserDidEndDocument:(NSXMLParser *)parser{
        [viewcontroller jobCompleted];
    }
    

    The other way is to take advantage of the delegate pattern and specifying a NSXMLParserDelegateDelegate Protocol (or named something else). That could look something like this:

    @protocol NSXMLParserDelegateDelegate
    
    -(void)parserDidEndDocument:(NSXMLParserDelegate *)parserDelegate;
    
    @end
    

    and then make a delegate property in your NSXMLParserDelegate

    @interface NSXMLParserDelegate : NSObject<NSXMLParserDelegate>{
        id<NSXMLParserDelegateDelegate> _delegate;
    }
    @property (assign) id<NSXMLParserDelegateDelegate> _delegate;
    
    @end
    

    remember to synthesize it in the .m file.

    The latter way of doing it will give you a more lose connection thus making it easier to move the thing around.

    Hope it helped.. Else let me know… And if I’m totally wrong here guys – let me know =)

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

Sidebar

Ask A Question

Stats

  • Questions 209k
  • Answers 209k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer solution seems pretty straightforward: >>> import math >>> mlat =… May 12, 2026 at 9:42 pm
  • Editorial Team
    Editorial Team added an answer public function RemoveItem($item) { foreach($this->shopcart as $i => $key) {… May 12, 2026 at 9:42 pm
  • Editorial Team
    Editorial Team added an answer Another idea (after googling) would be to avoid using <arg… May 12, 2026 at 9:42 pm

Related Questions

I am a beginner to iPhone App development. Please help me out. In my
I am having a heck of a time with this -- I am trying
I currently have an MS Access application that connects to a PostgreSQL database via
I currently have speakers set up both in my office and in my living

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.