Quote:
Originally Posted by roberthuttinger
im trying to create a button that will generate a random image every time it is pushed. so this leads me to a few questions. If I include the images in the app, then how do I dynamically pop up the image on the fly? Do I need to create a NSRect function to put the image in? can I store all the image names in an array of some sort to get a random image?
tia: rob
|
I would have a UIImageView in IB. Programmatically hide it until the button is pressed, then when the button is pressed generate a random number. Each number would be linked to a specific if statement (if number == 1, if number == 2, etc.) Then in each if have a different image being placed into the imageview, and unhide it.