internal compiler error: Bus error

I have the following code (see below) and if I compile it as is i get "internal compiler error: Bus error". If I comment out the last ImageOne.transform, everything works fine. If the file ends in .m it compiles fine if I change it to .mm then it has an issue. Any ideas?

[UIView animateWithDuration:duration1 delay:delay options:UIViewAnimationCurveEaseIn animations:^{
            ImageOne.transform = CGAffineTransformMakeScale(scale1, scale1);
            ImageOne.alpha = 1.0f;

        } 
                         completion:^(BOOL finished){
                             [UIView animateWithDuration:SecondDuration delay:SecondDelay options:UIViewAnimationCurveEaseOut animations:^{
                                 ImageOne.transform = CGAffineTransformMakeScale(scale2, scale2);
                             }
                                              completion:^(BOOL finished){
                                                  [UIView animateWithDuration:SecondDuration delay:SecondDelay options:UIViewAnimationCurveEaseOut animations:^{
                                                      ImageOne.transform = CGAffineTransformMakeScale(scale1, scale1); //results in bus error, i think its due to nesting

                                                  }
                                                                   completion:nil];
                                              }];
                         }];
    }

Why do you nest another block, rather than just adding

ImageOne.transform = CGAffineTransformMakeScale(scale1, scale1);

into the first block like so

completion:^(BOOL finished)
{
  [UIView animateWithDuration:SecondDuration delay:SecondDelay options:UIViewAnimationCurveEaseOut animations:^{
              ImageOne.transform = CGAffineTransformMakeScale(scale1, scale1);
              ImageOne.transform = CGAffineTransformMakeScale(scale2, scale2);

Hope this helps. :)

链接地址: http://www.djcxy.com/p/35368.html

上一篇: 什么是巴士错误?

下一篇: 内部编译器错误:总线错误