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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T00:51:42+00:00 2026-05-26T00:51:42+00:00

So lately I have been trying ways to pass data from a child to

  • 0

So lately I have been trying ways to pass data from a child to a parent view controller. I have settled with two. The delegates approach:

http://timneill.net/2010/11/modal-view-controller-example-part-2/

and the simple approach of just passing reference of the parent view controller to the child view controller before the child controller is pushed (UINavigationController) or presented (via modal presentation)

- (IBAction)myAction:(id)sender{
    MyViewController *myView = 
        [[MyViewController alloc] init];

    myView.isLinking = YES;
    myView.parent = self;


    // present child pushing or presentation logic here

    [sender resignFirstResponder];
}

but I’m wondering why should I go with delegates if I can do the latter when I only just want to be able to pass data from child to parent view controllers?

Also, there’s only about a few answers on SO where doing the latter is recommended. In fact, I can’t remember if there are.

So I was wondering, why is doing the latter not recommended and why are there more people suggesting delegates or even retrieving the controller from the application delegate?

  • 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-26T00:51:43+00:00Added an answer on May 26, 2026 at 12:51 am

    Because the second approach ties both the parent to the child and vice versa, making a circular dependency. This is bad OOP. Using delegates means the child view can be used from any manner of calling code, now or in the future.

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

Sidebar

Related Questions

Lately I have been trying my hands on Eclipse IDE for java development. I
So, I have been trying to understand Socket.io lately, but I am not a
Hi, i have been having some problems using JSON data in flash builder lately
I have been working with SharpSVN quite a bit lately and I'm currently trying
Okay so I have been trying to get into IoC lately. However, I keep
I have been trying to learn more about lambda expressions lately, and thought of
Lately I have been doing a security pass on a PHP application and I've
I've been playing around with boost::spirit::qi lately and have been trying to write my
i have been trying to get a screenshot lately but every thing in vain
I have lately been trying to read about how everything with strings and encodings

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.