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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T05:10:43+00:00 2026-05-29T05:10:43+00:00

So ideally I would like to use the UIDatePicker to display dates. But instead

  • 0

So ideally I would like to use the UIDatePicker to display dates. But instead of displaying a specific day (for the leftmost component) like Feb 2 I would like it to display a custom value like i.e Peter's birthday.

Is there a way to achieve this with using the UIDatePicker? Or do I have to create a UIPickerView and feed it with a datasource of dates and my custom values?

If so how would I go about feeding it with dates (what would my dataSource look like)?

  • 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-29T05:10:45+00:00Added an answer on May 29, 2026 at 5:10 am

    UIDatePicker only allows you do pick dates in som predefined styles like date,time,date+time etc…, so you would have to go with a UIPickerView.

    - (NSInteger)numberOfComponentsInPickerView:(UIPickerView *)pickerView
    {
        return 3;
    }
    
    - (NSInteger)pickerView:(UIPickerView *)pickerView numberOfRowsInComponent:(NSInteger)component
    {
        switch (component)
        {
            case 0: return self.birthdays.count;
            case 1: return 24;
            case 2: return 60;
            default: return -1;
        }
    }
    
    - (NSString *)pickerView:(UIPickerView *)pickerView titleForRow:(NSInteger)row forComponent:(NSInteger)component
    {
        switch (component)
        {
            case 0: return [[self.birthdays objectAtIndex:row] title];
            case 1: return [NSString stringWithFormat:@"%d", row];
            case 2: return [NSString stringWithFormat:@"%d", row];
            default: return nil;
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like to use the django contrib.admin pages to edit my models, but
I would like to animate movement on a SurfaceView . Ideally I would like
I have a route like following, ideally I would like it to match: domain.com/layout/1-slug-is-the-name-of-the-page
and it's linked to a 'confirm comment deleted page. Ideally I would like it
I would like to get a list of the wireless networks available. Ideally this
I would like to setup a multi-tenant ASP.NET MVC app. Ideally, this app would
I'd like to be able to unit test my Arduino code. Ideally, I would
Hey I'm used to developing in C and I would like to use C++
I would like to use components that are free for commercial use. I looked
Ideally I would like to monitor the signal strength of a wireless network in

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.