Solved

UiPickerview in Xcode

Posted on 2012-03-11
3
786 Views
Last Modified: 2012-03-12
Hello,

I have a single column uipicker in Xcode and I would like to have text pop up/appear that contains totally new text but is triggered by the picker selection. For example if I have a column of colors and Red is selected in the picker --- below the picker (not within), I want the text to appears as "apples, brick, strawberries."

Thank you!
0
Comment
Question by:mcliff1100
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 20

Accepted Solution

by:
darbid73 earned 500 total points
ID: 37708401
What you need to implement for your UIPicker is this;

- (void)pickerView:(UIPickerView *)pickerView didSelectRow: (NSInteger)row inComponent:(NSInteger)component {
    // Something is selected so now make text appear based on what is selected.
}

Open in new window


Here is the Apple Developer Reference on this.  Note you will get an index number of what was selected in the UIPicker.

In case you need an example there are lots.  I have just chosen one Example which I have not tried.
0
 

Author Closing Comment

by:mcliff1100
ID: 37709956
Is there a way to select a row of text but have alternate text appear below the picker in a label? Thanks
0
 
LVL 20

Expert Comment

by:darbid73
ID: 37710607
Your question seems very simple, or I am not understanding you.  Once the didSelectRow method is called because the user chooses something, you can make a label elsewhere anything you like.  Of course you will need to check what has been selected and then act appropriately based on the choice.
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Tired of waiting for your show or movie to load?  Are buffering issues a constant problem with your internet connection?  Check this article out to see if these simple adjustments are the solution for you.
Do you come here a lot? Are you lazy like me and don't want to go through the "trouble" of having to click your Dock's Safari icon and then having to click your Experts Exchange Favorites bookmark to get here? Well then this article is for you.
Users will learn how to set proper sequence settings, scale images, paste attributes, add transitions, fades, and music. Open up Final Cut Pro 7 and Create a new Project: Set the Sequence Settings. a) Click File > Easy Setup > Format > Apple ProRe…
Viewers will learn the basics of using Ableton Live's advanced sampler instrument, Sampler. Load new Sampler into an empty MIDI track: Select a sample and drop it into sample window in Sampler: Adjust pitch if necessary with Root Key setting: …

630 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question