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

Mockup & CodeGen, iPhone & iPad
($9.99)

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

Manu
($0.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum

View Single Post
Old 11-19-2009, 11:06 AM   #2 (permalink)
smasher
Senior Member
iPhone Dev SDK Supporter
 
smasher's Avatar
 
Join Date: Jul 2008
Location: San Mateo, CA (San Fran)
Posts: 3,858
Default

It's possible, but it's not what you want here - you should use an array instead. You can add all of your object to an NSArray (or NSMutableArray if you need to modify the list) and access them like this:

Code:
//add imageViews to the array - do this once
NSArray *imageViews = [[NSArray alloc] initWithObjects: q0, q1, q2, q3, q4, q5, q6, q7, q8, q9, nil];

//pull imageviews from the array
UIImageview *gradedImage = [imageViews objectAtIndex:currentQuestionNumber];
gradedImage.image = [imageViews imageNamed: imageLocation];

UIImageview *currrentImage = [myArray objectAtIndex:currentQuestionNumber+1];
currentImage.image = [UIImage imageNamed: currentAnswerImage];
__________________

Free Games!
smasher is offline   Reply With Quote
 

» Advertisements
» Online Users: 265
15 members and 250 guests
ADY, ckgni, her-ur, ilmman, imehl, iph_s, Jérémie_K., karunaskj, MarkC, marshusensei, mer10, peterkessler45, Rudy, Speed
Most users ever online was 1,187, 10-11-2011 at 08:09 AM.
» Stats
Members: 158,877
Threads: 89,218
Posts: 380,696
Top Poster: BrianSlick (7,129)
Welcome to our newest member, peterkessler45
Powered by vBadvanced CMPS v3.1.0

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