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

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

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

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum

View Single Post
Old 02-10-2010, 09:10 AM   #5 (permalink)
asimrs
Registered Member
 
Join Date: Aug 2009
Posts: 33
asimrs is on a distinguished road
Default

Quote:
Originally Posted by smasher View Post
If instruments says your net memory is going up continuously then you aren't releasing something properly. If you use the Object Allocations instrument and set an "inspection range" you should be able to tell what kind of objects are being created. You can also look at the net number of UIImage or UIImageView objects and see if that's what's increasing over time.

If it looks like those objects are the problem, then post an example of how you're adding an image to the screen.
Here are two methods for loading images, creating animations

-(NSArray *)loadImpactImagesNSString *)file_prefix NSInteger)loop_start NSInteger)loop_end
{

//set an array for computer impact images
NSMutableArray *imageArray =[NSMutableArray array];// [[NSMutableArray alloc] init];
//imageArray=nil;

NSString *cname;
NSString *imagePath;
int i;
UIImage *img;
for (i = loop_start; i <=loop_end ; i++) {



if([file_prefix isEqualToString:@"eclat vitre_00"])
{
//this is only for glass break aniamtion
cname = [NSString stringWithFormat:@"%@%d.png",file_prefix, i];

}
else
{
cname = [NSString stringWithFormat:@"%@%@%03d",levelPrefix,file_pref ix, i];
imagePath = [[NSBundle mainBundle] pathForResource:cname ofType:@"png"];
}

//UIImage *img = [UIImage imageNamed:cname];


img = [UIImage imageWithContentsOfFile:imagePath];

if (img)
{
[imageArray addObject:img];


}else{ NSLog(@"%@ not found",cname);}

img=nil;

pauseState=file_prefix;
pauseStateFrameNo = loop_end;

//}else{ NSLog(@"%@ not found",cname);}

}


//z [imagesCopy arrayByAddingObject:imageArray];
return imageArray;
}




//general function for animating the object moves
-(void)myAnimateObject{

//if(movingObject!=nil && sizeof(listdata)>0)
//{

movingObject.animationImages = listdata;


if(speed != customAnimationSpeed)
{
movingObject.animationDuration = customAnimationSpeed;
}
else
{
movingObject.animationDuration = speed ;//speed * ([listdata count]);
}


//movingObject.animationDuration = 0.5;// speed * ([listdata count]);

movingObject.contentMode = UIViewContentModeBottomLeft;


if(repeatAnimation==0)
{
[movingObject setAnimationRepeatCount:1];

}


[self.view addSubview:movingObject];

//NSLog(@"Added subview %@", movingObject);

[movingObject startAnimating];

self.pauseImage=[listdata objectAtIndex[listdata count]-1)];



movingObject.image=pauseImage; // logic to put last image of animation just after finishing the animation
[self.view bringSubviewToFront:glassCrackObject];



}
asimrs is offline   Reply With Quote
 

» Advertisements
» Online Users: 548
13 members and 535 guests
Domele, ganesh.sics, iconomania, ilmman, manop_cs, Matl43Owa, mistergreen2011, Newbie123, Objective Zero, oztemel, PavelSea, pinky, proindigo
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,448
Threads: 94,031
Posts: 402,607
Top Poster: BrianSlick (7,978)
Welcome to our newest member, Matl43Owa
Powered by vBadvanced CMPS v3.1.0

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