Solved

UiPickerview in Xcode

Posted on 2012-03-11
3
783 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
  • 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Preface   In the first 100 days of the Macintosh release in January 1984, Apple sold 72,000 of the computers. Relatively cheap, easy-to-use personal computer with a graphical operating system. I've never seen this model. I did see this one:   …
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.
Users will learn how resize a batch of photos from a single command in Photoshop via Photoshop's Image Processor. Open up an Image you'd like to resize in Adobe Photoshop: Adjust the image size according to your preferences. Image > Adjustments > …
This video teaches viewers how to process images for a time-lapse video. Programs required: Adobe Lightroom, Adobe After Effects, Video Editing Program. In Adobe Lightroom: Import sequence image files into Adobe Lightroom: Develop settings of an I…

828 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