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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T10:18:39+00:00 2026-06-06T10:18:39+00:00

I have one mainViewController and I have a UIPickerView. Now all is set up

  • 0

I have one mainViewController and I have a UIPickerView. Now all is set up well, but when I run the app and select the textField I get Question Marks in my UIPickerView list.

Now I have just learned that, that is because I have not connected the delegate for it.
However if I connect the delegate for it, then the textField does not get populated.

The TextField is in mainViewController.

So in my MainViewController.h I have imported the UIPickerView and have this code – which is all without errors. _pv is the UIPickerView.

 _pv = [[CategoryPicker alloc] init];

[_pv.categoryPicker setDelegate:self];
[_pv.categoryPicker setDataSource:_pv];

[_appPriorityTxtFld setInputView:_pv];
[_appPriorityTxtFld setInputAccessoryView:toolbar];

Now as you can see the Delegate is set to self, this will allow for the textField to be populated.

If I set that to _pv the then I get the list displayed properly, but the textField is not populated.

What am I missing??

Cheers

  • 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-06T10:18:41+00:00Added an answer on June 6, 2026 at 10:18 am

    You need to implement the picker delegate method “pickerView:didSelectRow:inComponent:” and you need to set the selected text as textfild text. see the following code for reference,

    - (NSString *)pickerView:(UIPickerView *)pickerView titleForRow:(NSInteger)row forComponent:(NSInteger)component
    {
        return [dataArray objectAtIndex:row];
    }
    
    - (void)pickerView:(UIPickerView *)pickerView didSelectRow:(NSInteger)row inComponent:(NSInteger)component
    {
        textField.text = [dataArray objectAtIndex:row];
    }
    

    I think this may useful.

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

Sidebar

Related Questions

Have two actionsheet buttons and one modalviewcontroller on mainviewcontroller in application. Now for two
I'm creating an app with one UIViewController and many UIViews. I have MainViewController with
I have one table having ID and other attributes. How can I get list
I have one control named thumbviewer inside repeater. I want to set its imageurl
I have one mainViewController that is also a delegate for a pickerview contained in
I have one single MainViewController which has of course it's one main UIView. I
Hey all, Here's a funny one. I have two ViewControllers: first one (fires on
In my app I have a basic Navigation Controller. For all of my views,
I have been going back through my app trying to handle all the memory
i am testing all day on this but i can not get it to

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.