Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

UiPickerview in Xcode

Posted on 2012-03-11
3
Medium Priority
?
789 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 2000 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: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone 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

In this article, I'll explain how to setup a Plex Media Server (https://plex.tv/) on a Redhat (Centos) 7 based NAS with screenshots to help those looking for assistance.  What is Plex? If you aren't familiar with Plex, it’s a DLNA media serv…
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.
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…
This video will demonstrate how to customize windows, tools, and control bars, and save them as screen sets. Open and resize windows: Customize the toolbar: Customize the control bar: Customize your tool selections: Your screen set is alread…

715 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