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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T09:18:50+00:00 2026-05-30T09:18:50+00:00

I have a UITableViewController which pushes a UIViewController and I need to pass two

  • 0

I have a UITableViewController which pushes a UIViewController and I need to pass two NSDates and a BOOL from that child view controller back to the table view controller.

How could I do this? Let me know if I am not being clear or you need more explanation.

I’d appreciate any help, thanks.

  • 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-30T09:18:51+00:00Added an answer on May 30, 2026 at 9:18 am

    Using a delegate is the proper way of passing info from one controller to another.

    Generally, what you want to do is to declare a protocol in your UITableViewController header, implement it, and then init the UIViewController with a delegate.

    In a nutshell, your UITableViewController .h file should have something like this:

    @protocol setDateDelegate <NSObject>
    @required
    - (void) setDateOne:(NSDate *)one dateTwo:(NSDate *)two;
    @end
    

    Then, you ought to implement the above mentioned class doing whatever you want to do with the dates in your UITableViewController .m file.

    In your UIViewController, you could (alternative at the end) define a custom init method:

    First, define a delegate property in your .h, and a custom init method, then implement it in your .m with something like this:

    - (id)initWithDelegate:(NSObject *)myDelegate
    {
    
        self = [super init];
        if (self) {
            self.delegate = myDelegate;
        }
        return self;
    }
    

    Next, when you need to pass the dates to your UITableViewController, just use
    [self.delegate setDateOne:one dateTwo:two];

    There are more ways of doing this, including skipping the custom init method and just setting the delegate after you create a UIViewController:

    MyUIViewController *viewController = [[[MyUIViewController alloc] init] autorelease];
    viewController.delegate = self;
    ...
    

    It’s more of a personal preference style.

    I’ve probably messed up the code (and forgotten a few bits) because I’m writing this off the top of my head, but it should be good enough to get you started.

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

Sidebar

Related Questions

I have a UITableViewController which in it's tableView:didSelectRowAtIndexPath method, sets up a view controller,
I have a UIViewController (parentVC) to which I add a UITableViewController as follows (it
I have a problem where I can successfully push a new view controller from
I am using iPhone SDK 3.1.3. I have a UITableViewController which gets data from
I have a UITableViewController in my app, which is added to the view hierarchy
I have a UITableViewController, which is RootViewController. It's XIB only has a table view.
I have presented the viewController which contains a navigation controller whose view is loaded
I have a UITableViewController which has two sections. The first section shows a single
I have a UITableViewController which has a UIView* called errorView that is used to
In my app, I have a UITableViewController which loads calculated data from my Core

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.