内部编译器错误:总线错误

发布于 2024-10-28 01:27:25 字数 1335 浏览 3 评论 0原文

我有以下代码(见下文),如果我按原样编译它,我会收到“内部编译器错误:总线错误”。如果我注释掉最后一个 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];
                                              }];
                         }];
    }

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

夕色琉璃 2024-11-04 01:27:25

为什么要嵌套另一个块,而不是像这样将

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);

希望这会有所帮助。 :)

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. :)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文