Advertise Books Events Forum News Social Networking Support Us

sdkIQ for iPhone
($4.99)

Shape Up
($0.99)

Your First iPhone App
($1.99)

iVidCam Free
(free)

Kid Art
($0.99)

iPUBQUIZ
(£1.19)

ArtStudio
($3.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum

View Single Post
Old 01-12-2009, 11:38 AM   #8 (permalink)
scotopia
Registered Member
 
scotopia's Avatar
 
Join Date: Oct 2008
Posts: 1,653
Default

You can find information on the docs on for loop pretty easily if you search around in "help" in xcode. I don't have my mac in front of me so I'll do the best I can from memory.

Basically it goes a little something like this:

Code:
int i;
NSString *loadString;

for(i = 0; i < 10; i++) {
loadString = [NSString stringWithFormat:@"hatAnimation%d", i]; 
[myImageArray addObject:[UIImage imageWithContentsOfFile:[NSBundle mainBundle] pathForResource:loadString ofType:@"png"]];

}
Now what this does will load in the images called hatAnimation1.png, hatAnimation2.png etc up to hatAnimation9.png.

Again, I am writing from memory here so my syntax might be slightly off but this is the jist; of course you must have your NSMutable Array allocated and released as usual in addition to the things above. Hope this helps!
scotopia is offline   Reply With Quote
 
Enter the iPhone App Challenge!  Win $500!
» Advertisements
» Stats
Members: 24,101
Threads: 38,877
Posts: 170,552
Top Poster: smasher (2,563)
Welcome to our newest member, kentz2010
Powered by vBadvanced CMPS v3.1.0

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