1. Welcome to the new MacRumors forums. See our announcement and read our FAQ

clock tik tik leak leak - GSEventRunModal

Discussion in 'iPhone/iPad Programming' started by IDMah, Aug 15, 2012.

  1. macrumors regular

    Hi all..

    Getting closer to a release.
    In Zombies I have a gazillion GSEventRunModal allocs.
    Figuring it has to do with My Animation images.

    Basically a clock. which ticks second animating to a frame and then pausing.

    Do I need to remove the animation after I animate it??

    here is the Animation code:
    -(void)animateTime:(NSArray *)framesArray 
    		  timeView:(UIImageView *)timeViewer
    	//UIImageView *animatedOSeconders = [[UIImageView alloc] initWithFrame:CGRectMake(18.5,315.5, 55.11, 55.11)];
    	animatedOSeconders = [[UIImageView alloc] 
    									   initWithFrame:CGRectMake(animPosX,animPosY, 55.11, 55.11)];
    	timeViewer.alpha = 1.00;
    	//[self.window addSubview:heldAnimatedOSeconders];
    	//[self.window bringSubviewToFront:timeViewer];
    	[self.window makeKeyAndVisible];
    	//animatedOSeconders.animationImages = [NSMutableArray arrayWithArray:oSecondesFrames];
    	timeViewer.animationImages = [NSMutableArray arrayWithArray:framesArray];
    	// One cycle through all the images takes 1 seconds
    	timeViewer.animationDuration = (totalFrames/12);
    	// Repeat forever
    	timeViewer.animationRepeatCount = 1;
    	// Add subview and make window visible
    	//[self.window addSubview:animatedOSeconders];
    	//[self.window insertSubview:timeViewer aboveSubview:heldAnimatedOSeconders];
    	[self.window makeKeyAndVisible];
    	//[animatedOSeconders release];
    	if (clockStart) {
    	if (!clockStart) {
    		//NSLog(@"animation begun");
    	[timeViewer startAnimating];
    	[self performSelector:@selector(doNothing) withObject:nil afterDelay:(totalFrames/12)];
    	//[timeViewer removeFromSuperview];
    no crashes but Zombies say I keep allocating memory.. and I'd like to plug as many leaks as I can before submission to itunes..


    [timeViewer removeFromSuperview];
    just crashes the app. think because it removes it before complete.. ?si? where is the correct place to do this?? in AnimationDidEnd?? stop???
  2. macrumors 603


    If you use ARC, will it not just handle the memory for you?
  3. macrumors regular

    Leaks, zombies, Allocation which do I use.

    Thanks trying to avoid arc right now.
    Part(s) as a lesson in writing good code and learning to debug better.

    Well I guess I'll keep slugging. but confused which tool is best for
    this sort of thing.. Zombies yields a lot of Data but so much that
    it constantly crashes. Leaks less but I don't get what it's telling me.

    any good (ie for a dummy like me) tutorials on memory leak finding???


Share This Page