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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T20:21:19+00:00 2026-05-28T20:21:19+00:00

So I’ve been working on fetching data from a web service and using it

  • 0

So I’ve been working on fetching data from a web service and using it in my app (e.g displaying a bunch of names in a UITableView)…

The guide I have been following to setting this up, set up the NSURLConnection in the AppDelegate, then had a XMLParser and a object for storing the fetched data…
Now, I want to move the connection set-up out and call from the AppDelegate and into a class of it’s own… But I’m a bit unsure about the approach…

I’m thinking something along the line of:

Child (object for storing data)

ChildParser (NSXMLParser)

SomeViewController (receives update notification from the parser and uses the data)

ChildMsg (set up the connection and SOAP message here)

Okay, so before the AppDelegate set up the connection and SOAP message in didFinishLaunchingWithOptions… and in connectionDidFinishLoading it initialized the ChildParser… then in the viewController it initiliazed the parser with:

appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];

and I could then access the Child data objects…

Okay, so what I’m thinking is that I should not be setting up the connection in the AppDelegate as I’m going to have 3-4 different connections and a bunch of SOAP messages for each connection, so it would quickly make a mess of the AppDelegate class… Therefore, I’m thinking that I’ll create a class for each of the different web service calls and then initialize these classes in a viewController when I need them…
But how would I do this?

Before I had this in my parser:

- (XMLParser *) initXMLParser {

    self = [super init];

    if(self)
    {
        appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
    }
    return self;
}

which I used to initialize it in the AppDelegate, so I’m guessing I’ll need something similar in ChildMsg

This rambling probably doesn’t make sense, but hopefully you understood what I want to achieve and can give me a nudge in the right direction…

Short summary: I’m parsing data for a web service, and I want to get the data in a viewController, but I want to set up the connection and SOAP message another place than the AppDelegate..

Thanks in advance

  • 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-28T20:21:21+00:00Added an answer on May 28, 2026 at 8:21 pm

    I would suggest trying to follow the MVC (Model View Controller) approach here. I think that you have pretty clear what your view and controller classes are; the model is where you could put your SOAP/XML code (or in a class that you access from the model).

    In this case, add an ivar to your controller to represent your model class. The model class should offer methods to update its content (i.e., get data from the web service) and to retrieve single pieces of data that your controller makes then available to the view it manages. The model class would then encapsulate your connection/request handling code, and (possibly, if I understand things correctly) also access ChildParser to build Child objects (that the view would use to display its content).

    This is just a rough sketch of how things would work. If you need more information about MVC, you could have a look to Wikipedia. Hope this helps.

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

Sidebar

Related Questions

That's pretty much it. I'm using Nokogiri to scrape a web page what has
We're building an app, our first using Rails 3, and we're having to build
I am using Paperclip to handle profile photo uploads in my app. They upload
I have a bunch of posts stored in text files formatted in yaml/textile (from
I have a jquery bug and I've been looking for hours now, I can't
link Im having trouble converting the html entites into html characters, (&# 8217;) i
For some reason, after submitting a string like this Jack’s Spindle from a text
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
Seemingly simple, but I cannot find anything relevant on the web. What is the
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and

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.