1

我有以下代码(见下文),如果我按原样编译它,我会得到“内部编译器错误:总线错误”。如果我注释掉最后一个 ImageOne.transform,一切正常。如果文件以 .m 结尾,如果我将其更改为 .mm ,它编译得很好,那么它就有问题了。有任何想法吗?

[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];
                                              }];
                         }];
    }
4

1 回答 1

1

为什么要嵌套另一个块,而不仅仅是添加

ImageOne.transform = CGAffineTransformMakeScale(scale1, scale1);

像这样进入第一个街区

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

希望这可以帮助。:)

于 2011-03-29T22:51:06.647 回答