Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

DVNO

macrumors newbie
Original poster
Jan 20, 2009
28
0
Hi, I want to know how I would be able to have my app choose a selection of text from a list of multiple selections when a button was pressed. In example, a random tip for an app every time a "give me a tip" button was pressed.
 
Once you have a random key, you could have a database, an array, a list of files or whatever with a number (say 1-50) identifying each piece of tip text that you draw upon when the button is pressed.

The random number therefore determines which decision is made.

To create the button that displays the view is easy using UIKit, which I hope you are familiar with. If not, you should read up on views etc using Appe's documentation.

The tip could be displayed in a label in a modal view, or perhaps in a UIAlertView. The opportunities are endless... ;)
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.