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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T12:07:23+00:00 2026-06-06T12:07:23+00:00

how to put this code below? – (void)pickerView:(UIPickerView *)pickerView didSelectRow:(NSInteger)row inComponent:(NSInteger)component { NSString *year

  • 0

how to put this code below?

- (void)pickerView:(UIPickerView *)pickerView didSelectRow:(NSInteger)row inComponent:(NSInteger)component
{
    NSString *year = [dateYear objectAtIndex:[picker selectedRowInComponent:0]];
    NSString *month = [dateMonth objectAtIndex:[picker selectedRowInComponent:1]];
    NSString *day = [dateDay objectAtIndex:[picker selectedRowInComponent:2]];
    labelDate1.text = [year stringByAppendingFormat:@" : %@ : %@", month, day];
}

into here?

- (IBAction)setDateBtn1:(id)sender {
    [UIView beginAnimations:nil context:NULL];
    [UIView setAnimationDuration:0.3];
    viewPicker.frame = CGRectMake(0, 0, 320, 460);
    [UIView commitAnimations];
}

My problem is, i have two button setDateBtn1 for labelDate1 and setDateBtn2 for labelDate2, both button calls one pickerView for input data that show at each label. After selecting date, it appears in labelDate1 only, no matter what button i call my pickerview, but what i want is setDateBtn1 for labelDate1 and setDateBtn2 for labelDate2. I hope you understand my english. For any help, thank you so much.

  • 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-06T12:07:25+00:00Added an answer on June 6, 2026 at 12:07 pm

    If I understand your question correctly, you have one picker method but two buttons (or labels) where either of which can bring up your picker. Selecting something in the picker should set label1 or label2.

    So… here’s an opportunity for you to make use of the picker view’s “tag” property.

    When bringing up the picker, set the “viewPicker.tag” to “1” (for label 1) and “2” if the button for label 2 brings up the picker.

    Then, in your “didSelectRow” function, you’ll know which label you’re doing the picking for. And you can do something like this:

    if(pickerView.tag == 1)
        labelDate1.text = [year stringByAppendingFormat:@" : %@ : %@", month, day];
    else
        labelDate2.text = [year stringByAppendingFormat:@" : %@ : %@", month, day];
    

    Hopefully I explained this well enough for you to keep going.

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

Sidebar

Related Questions

i want to put the id into the colorbox below this code nom works
I put this below code inside my *.dll for Internet Explorer. FILE *child =
Below specified code runs fine in ruby(console) irb but when i put this same
When I put this code in <asp:LoginStatus ID=LoginStatus1 runat=server style=top: 170px; left: 890px; position:
[Rails] Where to put this code? I have a user1 and when another registered
Okay, I know it is weird but when I put this code between <head
Maybe a very simple question. How can I put in this code <Query> <Where>
Edit: I put this snippet of code in jsbin: http://jsbin.com/eneru I am trying to
I have this code for update: public Boolean update() { try { data.put(ContactsContract.Groups.SHOULD_SYNC, true);
I have this code that I've edited: http://pastebin.com/vrqHek6S I've put in comments where I

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.