Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum

View Single Post
Old 09-04-2008, 01:25 PM   #2 (permalink)
Jeremy1026
1026 Development
 
Join Date: Jul 2008
Age: 23
Posts: 1,094
Jeremy1026 is on a distinguished road
Send a message via AIM to Jeremy1026
Default

Quote:
Originally Posted by roberthuttinger View Post
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.
Jeremy1026 is offline   Reply With Quote
 

» Advertisements
» Online Users: 750
16 members and 734 guests
7twenty7, drckmchaels, erdinc27, Fahad.bhutta, falco1973, iAppDeveloper, iOS.Lover, MarkC, matador1978, momolgtm, m_rozzi, Sophie100, teebee74, thewitt, tim0504, Wikiboo
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,474
Threads: 94,040
Posts: 402,625
Top Poster: BrianSlick (7,978)
Welcome to our newest member, m_rozzi
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 03:07 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.