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

  • Home
  • SEARCH
  • 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 8729975
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T08:55:39+00:00 2026-06-13T08:55:39+00:00

I am using UIPickerView in one of my view, in the same view, I

  • 0

I am using UIPickerView in one of my view, in the same view, I have to use the UIPickerView in more than 5 places. What I did was, created a outlet for UIPickerView and reused the same outlet in all location… for eg…

audio_cap_picker = nil;
// Creat picker view.
if (audio_cap_picker == nil) {
    audio_cap_picker = [[UIPickerView alloc] init];
    audio_cap_picker.delegate = self;
    audio_cap_picker.showsSelectionIndicator = YES;
    [self.view addSubview:audio_cap_picker];
}

Like above I have been creating the picker view when a button is clicked and its row title, and related information are set based on which button is clicked, It is working fine. However, the problem is when I am clicking a button because I am creating new every time, it is not highlighting the current selected row instead it is showing the first row as highlighted, so I was forced to use separate outlet for each UIPickerView.

Is there any way I can avoid creating different outlets for UIPickerView. Or is it the only way? which one is more efficient?

thanks.

  • 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-13T08:55:40+00:00Added an answer on June 13, 2026 at 8:55 am

    When the user selects the 5th row for example , you store a value, right?
    When you show the picker the next time , you can move it’s selection like this:

    int index = [valuessForFirstPicker indexOfObject:storeValueForFirstPicker];
    [picker selectRow:index inComponent:0 animated:TRUE];
    

    Hoep this helps.

    Cheers!

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

Sidebar

Related Questions

I have one music player with multiple sounds using picker view. My problem is
I have created a ViewController containing one picker. Its view is triggered to appear
I have created a custom view that contains a UIPickerView and a UITableViewCell to
I created my app using StoryBoard. Then, I added objective-c class to have .h
I am creating an app in IOS5 using storyboards. I created a UiPickerView and
I have created a new project in Ios5 using storyboards and my project has
I have a UIPickerView, in it's delegate I'm trying to customize the view for
I have a weird issue: I'm using a UIPickerView to pick some values. When
I created a UIPickerView inside an UIActionSheet , using the following tutorial: Add UIPickerView
I have two fields that call UIPickerView (Country and Province). I'm using inputView 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.