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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T00:20:23+00:00 2026-06-14T00:20:23+00:00

I have a UIActionSheet containing a picker and a UIToolbar . On the UIToolBar

  • 0

I have a UIActionSheet containing a picker and a UIToolbar. On the UIToolBar there is a done button. However, when I spin Picker component and before it stops spinning, if I tap Done button then I’m not getting any value in my UITextfield. If I tap the Done button after picker stops spinning animation, then I’m getting the value of selected component

Is there any way to get value of item before stop Animation..?

SOLVE

- (UIView *)pickerView:(UIPickerView *)pickerView viewForRow:(NSInteger)row forComponent:(NSInteger)component reusingView:(UIView *)view
{
     UILabel *lbl = (UILabel *)view;

           // Reuse the label if possible...
           if ((lbl == nil) || ([lbl class] != [UILabel class])) {
               CGRect frame = CGRectMake(0.0, 10.0, 250, 50);
               lbl = [[[UILabel alloc] initWithFrame:frame] autorelease];
           }
    if (component == 0) {

        lbl.textColor = [UIColor blackColor];
        lbl.textAlignment=UITextAlignmentLeft;
        lbl.backgroundColor = [UIColor clearColor];



        lbl.text = [arrCountry objectAtIndex:row];
        lbl.font=[UIFont boldSystemFontOfSize:14];
         NSInteger clm1 = [pickerView2 selectedRowInComponent:component];


        txtCountry.text = [arrCountry objectAtIndex:clm1];
        countryCode=[arrCountryCode objectAtIndex:clm1];
    }

    return lbl;
}

and also

- (void)pickerView:(UIPickerView *)pickerView didSelectRow:(NSInteger)row inComponent:(NSInteger)component{

  txtCountry.text = [arrCountry objectAtIndex:row];
  countryCode=[arrCountryCode objectAtIndex:row];
}
  • 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-14T00:20:25+00:00Added an answer on June 14, 2026 at 12:20 am

    I don’t think you can mate. The UIPicker only calls didselectrow when the spinner has stopped, otherwise it is stuck on previous picked row. the first one in your case.

    The closest you can get your functionality using a uipicker is this delegate method:

    - (UIView *)pickerView:(UIPickerView *)pickerView viewForRow:(NSInteger)row forComponent:(NSInteger)component reusingView:(UIView *)view
    

    You’d have to see what view is on the screen and its offset from the center. Other than that, you can implement your own scrollview and have a uipicker overlay, but that involves a lot of work.

    OR! you can tell your users to use the uipicker the proper way lol.

    The other way to stop users to pressing save is to detect if the uipicker is spinning or not. I found this to help you.

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

Sidebar

Related Questions

I have an UIActionSheet and I am specifying the cancel button however it does
I have included UIActionSheet in my program.It contains 2 button say A and B.
I have got created a UIActionsheet programatically however I can't figure out how to
I have a view that has a button which brings up a UIActionSheet pop
I have a UIButton in my UITableViewCell . This button launches a UIActionSheet so
i have a uiactionsheet and the buttom button doesnt work correctly the first time
I have added MFMailComposeViewController to my application. In the MFMailComposeViewController there is a button
I have a UIActionSheet that pops up as soon as the initial view in
I have a UIActionSheet as follows: UIActionSheet *sheet = [[UIActionSheet alloc] initWithTitle:[NSString stringWithFormat: @Cancel
I have a UIActionSheet which has options to choose image from Camera or photo

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.