Solved

UiPickerview in Xcode

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

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

I have a Synology DS212+ NAS.  These are not only great for backup and normal NAS stuff, but also for delivering media throughout your home or LAN via DLNA.  I copied my whole audio collection from iTunes over to the box, but couldn't figure out how…
The advancements in today's technology are unparalleled. Much of the technology that we have could not have been imagined twenty years ago. One of the latest additions to the list of technological advances is virtual reality. Virtual reality has an …
Viewers will get an overview of how to make and use Drum Racks in Ableton Live. Load new Drum Rack into empty MIDI track: Fill rack with audio samples: Re-arrange sample slots as necessary: Adjust parameters of each slot to tailor each sound a…
Viewers will learn how to include realistic velocity sensitivity to their Sampler instruments. Set the Vol<Vel parameter in the Filter/Global tab to your desired setting: Gather samples of hits of various intensity, and drag/drop into Velocity zon…

739 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