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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T17:07:44+00:00 2026-05-24T17:07:44+00:00

Goodday, I got the following problem: In my view, i got a texfield, which

  • 0

Goodday,

I got the following problem:

In my view, i got a texfield, which i am creating in code. The UITextfield is getting build in the code like this:

UITextField *filiaalSelection = [[UITextField alloc] init];
filiaalSelection.frame = CGRectMake(130, 100, 200, 30);
filiaalSelection.borderStyle = UITextBorderStyleLine;
filiaalSelection.delegate = self;

Now when i begin editing the textfield, an UIPickerView needs to popup. I do this in the following code:

-(void)textFieldDidBeginEditing:(UITextField *)filiaalSelection {
[filiaalSelection resignFirstResponder];

UIPickerView *myPicker = [[UIPickerView alloc] initWithFrame:CGRectMake(0, scrollView.frame.size.height - 225, scrollView.frame.size.width, 180)];

[myPicker setDelegate:self];
[myPicker setDataSource:self];
myPicker.showsSelectionIndicator = YES;

[self.view addSubview:myPicker];


}

Now i need to do 2 things. The first thing is:
Getting the value of my UIPickerView and insert it at the UITextField. The following method returns the current value of the UIPickerView selected:

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

    [stringsArray objectAtIndex:row];

}

But the problem is, that i don’t know how to send the value to the textfield. And i also need a done button above the UIPickerView. What is the best method for this?

  • 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-24T17:07:44+00:00Added an answer on May 24, 2026 at 5:07 pm

    Is there any reason you can’t just do this?

    - (void)pickerView:(UIPickerView *)pickerView didSelectRow:(NSInteger)row inComponent:(NSInteger)component {
    
        [filiaalSelection setText:(NSString *)[stringsArray objectAtIndex:row]];
    }
    

    As for the done button, to make things easy for yourself you should make the picker view the text fields inputView. Then it will be automatically shown and dismissed when the field begins or ends editing (when [textfield resignFirstResponder]; is called).

    You can then either add the button to the view somewhere or set it as the text field’s inputAccessoryView if you want it to be attached to the top of the picker view.

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

Sidebar

Related Questions

Goodday everybody, My problem is the following: I am communicating with serialport to a
Good day. I got a problem about the attribute of ref for my XSD
Good day everybody! Having the following code: template<typename T, typename OutStream = std::ostream> struct
Good day. I never really got a good hand at JavaScript, therefore this unusual
Good day. I got an HTML page which is small and has no scroll
Good day. I'd like to ask a question. Why TextBox control Txt in this
Goodday, I got an application where an user logs in, and when the log
Goodday, I have a little problem finishing off a project. I am not very
Good day, PowerShell rookie here... If I output to the screen like this: foreach($databasePermission
Good day! I use strategy to handle 404 errors like this: Error handling for

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.