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

  • Home
  • SEARCH
  • 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 7091715
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T08:13:16+00:00 2026-05-28T08:13:16+00:00

(iOS) I have a UITableView as a root view (screen 1). when a cell

  • 0

(iOS)
I have a UITableView as a root view (screen 1). when a cell is selected, it pushes a new UIView (screen 2) which contains two buttons. When one of those buttons is pressed, a new UIView is pushed (screen 3).
I would like to pass some key-value pairs from screen 1 to both screen 2 and screen 3. Using the following code I can pass values to screen 2 with no problem, but screen 3 returns zero as the value, regardless of which cell is picked. Any help on why this is happening would be great. (The alternative is to use switch-cases in screen 2 to pass values to screen 3)

Screen 1:

NSIndexPath *indexPath = [self.tableView indexPathForCell:sender];
NSDictionary *sentItems = [NSDictionary dictionaryWithObjectsAndKeys:indexPath, @"indexPath", nil];
[destination setValue:sentItems forKey:@"sentItems"];
  • 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-28T08:13:17+00:00Added an answer on May 28, 2026 at 8:13 am

    The solution I would think would be easiest is to pass along a sentItems or similar dictionary with all the values you could need during initialisation of the second and third views.

    So if you need values X,Y for view 2 and A,B,C for view 3 or D,E,F for the alternate button view 3, pass a dictionary with X,Y,A,B,C,D,E,F defined to view 2 before showing it, then pass the appropriate values to view 3 when you select one of the buttons but before showing that view.

    That saves looking back in the stack at all. If your first view is actually the root view of the application, you also have the option to define this dictionary in your application delegate class, so it becomes globally accessible via [[UIApplication sharedApplication] delegate].

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

Sidebar

Related Questions

I have a ViewController with a nib which have a UIView and a UITableView
I am an iOS development newbie. I have a settings screen which is a
I have a UITableView which uses a UIView subclass for its backgroundView and selectedBackgroundView
Sorry I'm pretty new to iOS dev. I have a UITableView setup from cells
using xcode 4.2 and iOS 5 and have nav bar on root controller and
So I have a UITableView in which I am doing batch insert/delete/reloads into. Every
I have an iOS 5 application with a storyboard and two scenes. Scene 1
I have a UITableview cell that gets a tally from a core data database.
I have a UITableView in a UIViewController on ipad (ios 4.3.3) I want the
I have to create a UITableView, that contains richly formatted text within each UITableViewCell.

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.