Problems of Memory, Navigation and Animations iOS 6?

144 views Asked by At

in my project I have like 10 view controllers: Navigation-> 1-> 2-> 3-> 4-> 5-> 6-> 7-> 8-> 9-> 10; any view controller have a custom animation, with the navigation controller I go one for one view controller with a modal segue cross dissolve, I can Go back in this way too 10-> 9-> 8-> 7-> 6-> 5-> 4-> 3-> 2-> 1;, but when I'm in the 8 or 9 view controller the app close, or crashes, and I don't know WHY!!!, the code I'm use for any view controller is:

- (void)viewDidLoad
{
  NSLog(@"view did load");
  [super viewDidLoad];
  // Do any additional setup after loading the view.

  [self mostrarAnimacion];
}

- (void)didReceiveMemoryWarning
{
  [super didReceiveMemoryWarning];
  // Dispose of any resources that can be recreated.
  NSLog(@"Problemas de Memoria View Controller #(number of ViewController)");
}

- (void)getArrayEffectAnimacion
{
   NSMutableArray *arrayBall = [[NSMutableArray alloc] init];

   for (int i=0; i<9; i++) {
     UIImage *image = [UIImage imageWithData:
         [NSData dataWithContentsOfFile:[[NSBundle mainBundle] 
             pathForResource:
             [NSString stringWithFormat:@"imagen00%d.png", i] ofType:nil]]];
     [arrayBall addObject:image];
   }
   self.arrayEffectAnimacion = [NSArray arrayWithArray:arrayBall];
}


-(IBAction)Animacion
{

   [self getArrayEffectAnimacion];
   self.imgAnimacion.animationImages = self.arrayEffectAnimacion;
   self.imgAnimacion.animationDuration = 1.0f;

   [self.imgAnimacion setAnimationRepeatCount:1];
   [self.imgAnimacion startAnimating];

 }



- (void)viewWillDisappear:(BOOL)animated
{
   NSLog(@"View controller #(number of viewcontroller) desaparece");
   [super viewWillDisappear:animated];

   self.imgAnimacion.animationImages = nil;

}

 - (void) mostrarAnimacion
 {

    if (ES_IPAD())
    {

         [UIView animateWithDuration:15.0f delay:1 
             options:UIViewAnimationOptionRepeat animations:^{
              imagen.frame = 
                   CGRectMake(1024,imagen.frame.origin.y,  
                              imagen.frame.size.width, 
                              imagen.frame.size.height);
              } completion:nil];
    }
    else
    {
        if (ES_IPHONE_5)
        {

            [UIView animateWithDuration:25.0f delay:1 
                options:UIViewAnimationOptionRepeat animations:^{
                       imagen.frame = CGRectMake(568,imagen.frame.origin.y,
                            imagen.frame.size.width, imagen.frame.size.height);
            } completion:nil];
        }
        else
        {

            [UIView animateWithDuration:25.0f delay:1 
              options:UIViewAnimationOptionRepeat animations:^{
                ViewNubes.frame = CGRectMake(480,imagen.frame.origin.y, 
                     imagen.frame.size.width, imagen.frame.size.height);
            } completion:nil];
        }
    }

}

-(IBAction)TapUNO:(UITapGestureRecognizer *)recognizer
{
   dispatch_async(dispatch_get_main_queue(), ^{
       [self Animacion];
    });
}

So when I'm in the 8 or 9 view controller the app Crashes or close and print me the nslog's: only in the last view controller before crashes

2013-08-26 12:15:18.292 PRUEBA[214:907] Received memory warning.
2013-08-26 12:15:18.310 PRUEBA[214:907] Problemas de Memoria View Controller 01
2013-08-26 12:15:18.314 PRUEBA[214:907] Problemas de Memoria View Controller 02
2013-08-26 12:15:18.318 PRUEBA[214:907] Problemas de Memoria View Controller 01
2013-08-26 12:15:18.319 PRUEBA[214:907] Problemas de Memoria View Controller 02
2013-08-26 12:15:18.321 PRUEBA[214:907] Problemas de Memoria View Controller 03
2013-08-26 12:15:18.324 PRUEBA[214:907] Problemas de Memoria View Controller 04
2013-08-26 12:15:18.327 PRUEBA[214:907] Problemas de Memoria View Controller 05
2013-08-26 12:15:18.328 PRUEBA[214:907] Problemas de Memoria View Controller 06
2013-08-26 12:15:18.330 PRUEBA[214:907] Problemas de Memoria View Controller 07
2013-08-26 12:15:18.333 PRUEBA[214:907] Problemas de Memoria View Controller 08
2013-08-26 12:15:18.336 PRUEBA[214:907] Problemas de Memoria View Controller 09

is like if each view controller will run all the time but only show me the actual, so how can I finish or close a view controller to go the next or another, is for the modal segue?? in cross dissolve?, Im using in wrong way the animations?, I see another questions but, I don't know how fix this!!! how fix this any help?, Im using xcode 4.5 for iOS 6

OK suddenly get this me now or print me:

2013-08-26 18:41:56.717 PRUEBA[7488:907] view did load page 1
2013-08-26 18:42:17.848 PRUEBA[7488:907] view did load page 2
2013-08-26 18:42:18.219 PRUEBA[7488:907] page 1 desaparece
2013-08-26 18:42:33.903 PRUEBA[7488:907] view did load page 3
2013-08-26 18:42:34.283 PRUEBA[7488:907] page 2 desaparece
2013-08-26 18:42:48.345 PRUEBA[7488:907] view did load page 4
2013-08-26 18:42:48.707 PRUEBA[7488:907] page 3 desaparece
2013-08-26 18:43:02.223 PRUEBA[7488:907] view did load page 5
2013-08-26 18:43:02.565 PRUEBA[7488:907] page 4 desaparece
2013-08-26 18:43:15.596 PRUEBA[7488:907] view did load page 6
2013-08-26 18:43:15.896 PRUEBA[7488:907] page 5 desaparece
2013-08-26 18:43:22.393 PRUEBA[7488:907] view did load page 7
2013-08-26 18:43:22.791 PRUEBA[7488:907] page 6 desaparece
2013-08-26 18:43:27.868 PRUEBA[7488:907] view did load page 8
2013-08-26 18:43:28.250 PRUEBA[7488:907] page 7 desaparece
2013-08-26 18:43:33.504 PRUEBA[7488:907] view did load page 9
2013-08-26 18:43:33.797 PRUEBA[7488:907] page 8 desaparece
2013-08-26 18:43:43.015 PRUEBA[7488:907] view did load page 10
2013-08-26 18:43:43.505 PRUEBA[7488:907] page 9 desaparece
2013-08-26 18:46:23.233 PRUEBA[7488:907] Received memory warning.
2013-08-26 18:46:23.635 PRUEBA[7488:907] Problemas de Memoria View Controller 01
2013-08-26 18:46:23.755 PRUEBA[7488:907] Problemas de Memoria View Controller 02
2013-08-26 18:46:23.786 PRUEBA[7488:907] Problemas de Memoria View Controller 03
2013-08-26 18:46:23.828 PRUEBA[7488:907] Problemas de Memoria View Controller 04
2013-08-26 18:46:23.841 PRUEBA[7488:907] Problemas de Memoria View Controller 05
2013-08-26 18:46:23.862 PRUEBA[7488:907] Problemas de Memoria View Controller 06
2013-08-26 18:46:23.875 PRUEBA[7488:907] Problemas de Memoria View Controller 07
2013-08-26 18:46:23.889 PRUEBA[7488:907] Problemas de Memoria View Controller 08
2013-08-26 18:46:23.908 PRUEBA[7488:907] Problemas de Memoria View Controller 09
2013-08-26 18:46:23.946 PRUEBA[7488:907] Problemas de Memoria View Controller 10
2013-08-26 18:46:23.990 PRUEBA[7488:907] Problemas de Memoria View Controller 09
2013-08-26 18:46:24.040 PRUEBA[7488:907] Problemas de Memoria View Controller 08
2013-08-26 18:46:24.054 PRUEBA[7488:907] Problemas de Memoria View Controller 07
2013-08-26 18:46:32.077 PRUEBA[7488:907] view did load page 1
2013-08-26 18:46:32.704 PRUEBA[7488:907] view did load page 2
2013-08-26 18:46:33.090 PRUEBA[7488:907] view did load page 3
2013-08-26 18:46:33.521 PRUEBA[7488:907] view did load page 4
2013-08-26 18:46:33.946 PRUEBA[7488:907] view did load page 5
2013-08-26 18:46:34.354 PRUEBA[7488:907] view did load page 6
2013-08-26 18:46:34.821 PRUEBA[7488:907] view did load page 7
2013-08-26 18:46:35.368 PRUEBA[7488:907] view did load page 8
2013-08-26 18:46:35.857 PRUEBA[7488:907] view did load page 9

why from all viewcontroller the viewDidLoad method run in the same time from each viewcontroller??? is problem from memory? Navigation?? please help guys

0

There are 0 answers