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 01-12-2009, 12:38 PM   #8 (permalink)
scotopia
Registered Member
 
scotopia's Avatar
 
Join Date: Oct 2008
Posts: 2,028
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
 

» Advertisements
» Online Users: 680
20 members and 660 guests
ADY, AngryOrange, BrianSlick, DJFrail, flamingliquid, GHuebner, HDshot, headkaze, jakerocheleau, JasonR, mer10, Monstertaco, nimesh_158, Reyna, RickSDK, themathminister, timle8n1, Touchmint, ungureanuvlad
Most users ever online was 1,187, 10-11-2011 at 08:09 AM.
» Stats
Members: 158,558
Threads: 89,129
Posts: 380,267
Top Poster: BrianSlick (7,105)
Welcome to our newest member, thesooty
Powered by vBadvanced CMPS v3.1.0

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