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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T00:14:27+00:00 2026-05-28T00:14:27+00:00

I have a picker view in a view controller page,say view controller1.Now I have

  • 0

I have a picker view in a view controller page,say view controller1.Now I have a requirement of accessing the selected string value from that picker view in another view controller say view controller 2.

This is because,I have a table view which displays the saved data corresponding to 4 groups i.e. my application is reminder application which user saves the reminder,that is visible in view reminder page.The reminders are saved by the user in respective groups,say friends,family,office etc… So I have earlier retrieved in a bad programming context,i.e.

I took 4 view controllers for displaying reminders corresponding to 4 groups i.e. say friendsViewController for displaying reminders corresponding to friends using the query

NSString *getQuery = [NSString stringWithFormat:@"SELECT * FROM reminders WHERE Grp = 'Friends' GROUP BY Name,Event,Date"];

Like wise for group family,office and acquaintances.Hence for shifting the context of bad programming to a good programming habit,I have got an idea of using the query:

NSString *getQuery = [NSString stringWithFormat:@"SELECT * FROM reminders WHERE Grp = '%@' GROUP BY Name,Event,Date",**selected string value from the picker in previous view**];

Please identify the change I am trying to do,i.e. Grp = ‘%@’-The string is selected value from row component in picker view which is in previous view.

I am aware of 2 possible ways for getting access,

1.subclassing the view controller i.e. 

@interface viewController2:viewController1,but I already have subclassed i.e.:

@interface viewController2:addReminderController ,so I cant subclass twice,I am not aware too!

2. Creating an instance object of the viewController1 i.e. 

viewController1 *vC1 and I tried to access the groupPicker like [vC1.groupPicker selectedRowInComponent:row],

but as we can expect it throws an error i.e. row undeclared ,

I tried to access the array as I have assigned for number of rows in component for groupPicker as [self.groupArray count],so I tried to make the tactic work in viewController2 too i.e.:

[vC1.groupArray objectAtIndex:row],as expected the same error: **row undeclared**

So how can I get access to row(string) selected in picker view which is present in previous view,so that I can exhibit good programming habit which is a good sign in future for a fresher like me 🙂

Please help me with some valuable suggestions

Thanks all in advance 🙂

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

    Step 1: Take a NSString variable in your appDelegate.

    Step 2: create instance of appDelegate in your both view were your want to set value and get value as following.

    yourApplicationDelegate *appDelegate;
    

    Step 3: init appDelgate in implementation file as following

    appDelegate = [[UIApplication sharedApplication] delegate];
    

    after this statement you can use the string variable from both view controller you declared in appDelegate of you application.

    That’s it. now you can assign value from first view and access it in second view.

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

Sidebar

Related Questions

I have a picker view that has a list of numbers to pick from.
I have a picker view controller to select a chemical source and possibly a
I have a view containing a segmented controller and a UIDatePicker that only shows
I am making a color picker. I have the following code: View controller.h: @interface
I have a view controller that I would like to present in a modal
I have picker controls on a single view with two outlets for each. When
I have a date picker library written for MooTools that I want to port
I have created a dynamic list picker script using Jquery 1.3 and PHP that
I have a requirement to use date picker in my applicaiton. I have lot
I'm writing an iPhone app. Starting from a view controller in a navigation stack

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.