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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T04:37:46+00:00 2026-05-30T04:37:46+00:00

i have a class RequestHandler that takes the requests for some ViewController and fetches

  • 0

i have a class RequestHandler that takes the requests for some ViewController and fetches data on the web asynchronously. In order to notify the ViewController, it implements a protocol and the ViewController is set as its delegate.

Now, this ViewController is a TableViewController, and when a row is selected, it pushes a second ViewController on the NavigationStack. This second (child) ViewController needs to use the RequestHandler too. How can i make it a delegate for the same RequestHandler instance? And how can i make sure it won’t mess with the parent TableViewController once i go back to 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-30T04:37:47+00:00Added an answer on May 30, 2026 at 4:37 am

    The fact that both view controller would want the same request suggests a design error. The view controllers should display the current state of the Model. They should not directly deal with active network requests.

    You should have some group of classes that represent your data. These are called the Model. View controllers should only care about the model while the view is onscreen. So a reasonable pattern looks like this:

    • ViewController registers for notifications of changes in the Model
    • ViewController updates view with current data from Model.
    • ViewController requests an update.
    • RequestManager (singleton) creates a new RequestHandler to process it.
    • When RequestHandler finishes, it tells RequestManager and is released.
    • RequestManager updates Model with new data
    • Model alerts registered observers that it has changed.
    • ViewController updates view with current data from Model.

    Now it doesn’t matter if the user is on this view, or has moved to another, or moves to another and comes back. In call cases, any time the model changes, the current view is updated.

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

Sidebar

Related Questions

I have class with a member function that takes a default argument. struct Class
I have a BaseHandler class that subclasses the Tipfy RequestHandler in my AppEngine site.
I have a class that doesn't extend webapp.RequestHandler , and I can't use self.response.out.write()
I have something like this set up: class CategoryPage (webapp.RequestHandler): def get(self): ** DO
I have class method that returns a list of employees that I can iterate
I have: class MyClass extends MyClass2 implements Serializable { //... } In MyClass2 is
I am trying to make some data from database available using XML, I have
I have a server side code to process uploaded binary files: class UploadHandler(webapp.RequestHandler): def
I have a webform-based macroeconomics model here that takes parameters and inputs and solves
I have class A: public class ClassA<T> Class B derives from A: public class

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.