Solved

UiPickerview in Xcode

Posted on 2012-03-11
3
771 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 19

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 19

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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

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 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…
Viewers will learn how to turn a Live Set into a compressed Live Pack file, and how to install Live Packs. Make: File > Collect All And Save: File > Manage Files: Click Manage Project: Click Create Pack: Select save location: Install: Doub…

708 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now