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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T18:59:31+00:00 2026-05-22T18:59:31+00:00

I have one application in which when user clicks a button i want to

  • 0

I have one application in which when user clicks a button i want to open uipickerview as as subview to main view and after user selects an item it should be removed from main view.(drop down kind of functionality).For that i have written code as below:

-(void)showPrefPicker:(id)sender
{


   UIView *subView=[[UIView alloc] init];
   subView.frame=CGRectMake(180, 120, 150, 150);
   pickerView = [[UIPickerView alloc] init];

    pickerView.showsSelectionIndicator = YES;
    pickerView.dataSource = self;
    pickerView.delegate = self;
    pickerView.frame=CGRectMake(190, 130, 100, 100);
    subView.backgroundColor=[UIColor blackColor];
    [subView  addSubview:pickerView];
    [self.view addSubview:subView];
    [pickerView release];

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

- (void)pickerView:(UIPickerView *)pickerView didSelectRow:(NSInteger)row inComponent:(NSInteger)component
{
    NSLog(@"selected object is %@",[arraypref objectAtIndex:row]);
    //[pickerView ]
    //mlabel.text=  [arrayNo objectAtIndex:row];
}

- (NSInteger)pickerView:(UIPickerView *)pickerView numberOfRowsInComponent:(NSInteger)component;
{
    return [arraypref count];
}

- (NSString *)pickerView:(UIPickerView *)pickerView titleForRow:(NSInteger)row forComponent:(NSInteger)component;
{
    return [arraypref objectAtIndex:row];
}

but is only showing subview in the main view not the pickerview.how can i do that any tutorial or source code for that?

  • 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-22T18:59:31+00:00Added an answer on May 22, 2026 at 6:59 pm

    Better you use

    to hide

    pickerview.hidden=YES;
    

    to show

    pickerview.hidden=NO;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an application which may only have one instance of itself open at
My application is viewbased application in which I have one button. On click of
I have Java application which adds JTextFields @ runtime to JPanel. Basically user clicks
I have one Application which has more then 5 Activity I want to know
I have implement one application in which four image button and on image button
i am doing one small application , wheich have login functionality, in the user
In one of my applications I have a class which is responsible for user
I have one application which uses the standard .NET forms authentication cookie, now I
The problem: we have one application that has a portion which is used by
I have an application which obtains data in JSON format from one of our

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.