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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T11:23:09+00:00 2026-06-07T11:23:09+00:00

Ok I am trying to connect a UIPickerView with a custom class. The idea

  • 0

Ok I am trying to connect a UIPickerView with a custom class. The idea is to have 3 picker views in one normal view.

  1. So far I have created one view and bound it to my class TestView.h
  2. Then I added a picker view to the view in the storyboard (iOS 5)
  3. I then created a class for this picker view:

    @interface TestPickerView : UIPickerView <UIPickerViewDelegate, UIPickerViewDataSource> 
    {  
      NSArray *data;  
    }
    
  4. Then tried to add a Property to my normal view (TestView.h)

    #import "TestPickerView.h"
    @interface TestView : UIViewController
      @property (strong, nonatomic) IBOutlet TestPickerView *myTestPicker;
    @end
    

But how do i bind the UIPickerView inside my normal view to this class/property?

I will in the end have 3 UIPickerView’s and my idea was to have 3 references in my UIViewController to control these UIPickerViews. That way I could set the data (datasource) using the properties once when the normal view is loading and then the PickerViews would just show. Hopefully i would also be able to get notified in my normal view when the value in one of the views occur.

  • 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-07T11:23:11+00:00Added an answer on June 7, 2026 at 11:23 am

    Please call your TestView >> TestViewController instead, as it is a controller.

    In your storyboard, select the PickerView and change it’s class name to TestPickerView.

    enter image description here
    enter image description here

    After that just create your three IBOutlets and connect the PickerViews. That’s it.

    // edit: To explain, how you distinguish between the pickers. Make 3 outlets, e.g.:

    IBOutlet TestPickerView *picker1;
    IBOutlet TestPickerView *picker2;
    IBOutlet TestPickerView *picker3;
    

    And than in your delegate method, check which picker did call the delegate, e.g.:

    - (void)pickerView:(UIPickerView *)pickerView didSelectRow:(NSInteger)row inComponent:(NSInteger)component
    {
        if(pickerView == self.picker1)
        {
            // picker1
        }
        else if(pickerView == self.picker2)
        {
            // picker2
        }
        else
        {
            // picker3
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

When trying to connect to a server, my app does not have a very
I have been trying for 2 days now to get a UIPickerView to show
Am trying to connect the App Delegate to the View Controller in Xcode4, but
I have been trying to connect to mysql all evening using PHP. I know
I am trying to connect to Oracle DB using JDBC. I have put ojdbc.jar
I am trying to connect to unix domain socket created by another process. here
Im trying to connect to the Magento 1.4.0.1 API, but until now I have
Im trying to connect to a SOAP service using Android and have read in
Iam trying to connect my App to a WCF service that I created in
I'm trying to connect to databse using jade java and jdbc public class IntermediaryAgent

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.