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:11 PM   #4 (permalink)
scotopia
Registered Member
 
scotopia's Avatar
 
Join Date: Oct 2008
Posts: 2,028
Default

What I have found to work well is to load my images in an NSMutableArray using the addObject method with code as follows:

Code:
[myImageArray addObject:[UIImage imageWithContentsOfFile:[NSBundle mainBundle] pathForResource:@"image1" ofType:@"png"]];
Note that imageWithContentsOfFile does not cache the image in memory (which is generally better for most purposes to save memory).

I am using openGL now so I am actually adding Texture2Ds but the above code will work for regular images.
scotopia is offline   Reply With Quote
 

» Advertisements
» Online Users: 735
20 members and 715 guests
cbrauchli, ChenXin, chits12345, gc2010, Grace.H, gurumoorthy, ilmman, JamesCahall, kaileymo123, Lanka001, Leoknico, mapiko, mikeporras, Moe2392, MozyMac, nidie, rrlemoine, supasounds, xlc
Most users ever online was 1,187, 10-11-2011 at 08:09 AM.
» Stats
Members: 158,813
Threads: 89,206
Posts: 380,630
Top Poster: BrianSlick (7,129)
Welcome to our newest member, Leoknico
Powered by vBadvanced CMPS v3.1.0

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