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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T08:57:35+00:00 2026-05-23T08:57:35+00:00

So my UIPickerView does not get connected to the DataSource. I Have no idea

  • 0

So my UIPickerView does not get connected to the DataSource. I Have no idea WHY.

I create a file with UIPickerViewDelegate and UIPickerViewDataSource, and properly do the procedure for bringing a UIPickerView on tapping a textField.

The pickerView works , but does not show any component. I have implemented

-(NSInteger)numberOfComponentsInPickerView:(UIPickerView *)pickerView
{
return 3;
}

- (NSInteger)pickerView:(UIPickerView *)thePickerView numberOfRowsInComponent:(NSInteger)component 



- (NSString *)pickerView:(UIPickerView *)thePickerView titleForRow:(NSInteger)row forComponent:(NSInteger)component { 


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


- (CGFloat)pickerView:(UIPickerView *)pickerView widthForComponent:(NSInteger)component{

Any idea why the pickerView is not getting connected to the DataSource ? I also tried NSLogging inside all these methods. // Does not print

I had also set

packSizePopPickerView.delegate = self;
packSizePopPickerView.dataSource = self;
packSizePopPickerView = [[UIPickerView alloc] init];
  • 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-23T08:57:35+00:00Added an answer on May 23, 2026 at 8:57 am

    In cellForRowAtIndexPath, you’re setting packSizePopPickerView’s dataSource/delegate, and THEN allocating/initializing packSizePopPickerView to a new UIPickerView. The NEW UIPickerView no longer has its delegate/dataSource set.

    This is WRONG:

    packSizePopPickerView.delegate = self;
    packSizePopPickerView.dataSource = self;
    packSizePopPickerView = [[UIPickerView alloc] init];
    

    Try this:

    packSizePopPickerView = [[UIPickerView alloc] init];
    packSizePopPickerView.delegate = self;
    packSizePopPickerView.dataSource = self;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Does anyone have a basic example to display a UIPickerView when a UITextField was
I have the following code to create a UIPickerView: pickerView = [[UIPickerView alloc] initWithFrame:CGRectMake(0.0f,
I have a UIPickerView that gets faded out to 20% alpha when not in
I have a customized UIPickerview and I do not want to use a datepicker.
In Objective-C, I've seen, for example: UIPickerView *tweetPicker and UIPickerView* tweetPicker What does the
I have a UIPickerView as subview in a UITableViewController, which I want to slide
I have a UIPickerView on my UIView along with a UITextField . I am
I have an UIPickerView with 3 components populated with 2 NSMutableArrays (2 components have
I'm trying to have a UIPickerView slide from the bottom of the screen (over
I have a UIPickerView which works correctly, now I want to add a button

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.