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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T02:28:03+00:00 2026-06-08T02:28:03+00:00

I have a class, call it A that parses some data out in an

  • 0

I have a class, call it A that parses some data out in an NSDictionary. That class has a table view, and when a cell is selected, a new class instantiates, let’s call that class B. Class B in turn instantiates class C. I want class C to receive the NSDictionary that was created in A.

Would delegates work? Would it work even though class C isn’t instantiated? If that’s true and it really does not, should I pass the data from A–>B–>C in the init method? Are there better message passing methods in Objective-C?

  • 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-06-08T02:28:05+00:00Added an answer on June 8, 2026 at 2:28 am

    should I pass the data from A–>B–>C in the init method?

    I think that’s the best plan.

    A really shouldn’t have to worry about how B does what it does. The fact that B uses C is none of A’s business. All A needs to know is that B needs the dictionary in order to do it’s thing.

    As it happens, B doesn’t care all that much about the dictionary, but the dictionary should be part of B’s job description, which is something like: Take the data you’re given and display it somehow. If B deals with the dictionary by passing it directly to C, that’s fine — not something A should care about.

    You could do the same thing with a delegate. A could give B a reference to itself as a data source, and B could eventually pass that on to C. It’s the same process you’d have with the dictionary, so there’s no real advantage in doing that if you can put everything that C needs into the dictionary. You might consider switching to delegation if A doesn’t know in advance exactly what data is needed, or when you want A to be able to somehow customize the behavior of C.

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

Sidebar

Related Questions

I have a class (in C++), call it Data , that has thousands of
I have an object from a NSObject class that I call brand and has
I have jquery with class= modal i want to call that class when page
i have a class that uses a proxy class inside to call a service
I have a class that requires dynamically setting a List. I also call this
I have a non-Activity class (let's call it NonActivity) that needs to post a
First suppose that I have an abstract class, let's call it AbstractClass. Suppose public
I have a situation where I have an instanced class that needs to call
I have a some code that gets passed a class derived from a certain
I have a class, written in Java, that makes a call to a PHP

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.