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 07-10-2009, 02:14 AM   #3 (permalink)
AmitSrivastava
iPhone Developer
 
Join Date: May 2009
Location: Pune, India
Age: 23
Posts: 65
Default

Quote:
Originally Posted by smasher View Post
Were you calling "imageWithContentsofFile" every frame? You probably need to load your images into an array at startup, and then reference them each frame without recreating them.

"imageNamed" is faster when you recreate the same image over and over, but you should not need to recreate them over and over; also imageNamed uses more memory (to cache the images.)

Also, how big are the images? If they are full-screen you'll probably only get about 20 images loaded at once before you run out of memory.
Thanks for reply,
i am not recreating the images, i have stored in a NSMutable Array and using index of that Array,
Code:
- (void) initImages{
       XImg = [UIImage imageNamed:@"X.png"];
	[Xmages  addObject:XImg ];	
// 33 times	
}

- (void) XImage{		
	Ximageview.image = [Xmages objectAtIndex:XImageCount];
	
	XImageCount++;
	if(XImageCount>=33){
		XImageCount=0;	
	}
}
above all 33 image covers 70% of iPhone screen.

if i compress the png file, will it create any dfference?
AmitSrivastava is offline   Reply With Quote
 
Enter the iPhone App Challenge!  Win $500!
» Advertisements
» Stats
Members: 24,367
Threads: 39,159
Posts: 171,660
Top Poster: smasher (2,577)
Welcome to our newest member, jurosik
Powered by vBadvanced CMPS v3.1.0

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