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

我写了一个animation的代码,在屏幕上晃动一个UIImageView,但虽然语法看起来是正确的,但是在构build时,我却遇到了一个模糊的“ internal compiler error: Bus error: 10 ”。 任何想法为什么?

 -(IBAction)shakeCircle{ int d = 3; [UIView animateWithDuration:0.05 animations:^{myCircle.center = CGPointMake(myCircle.center.x+d, myCircle.center.yd);} completion:^(BOOL finished){ [UIView animateWithDuration:0.05 animations:^{myCircle.center = CGPointMake(myCircle.center.xd, myCircle.center.y+d);} completion:^(BOOL finished) { //but if I comment from here.. [UIView animateWithDuration:0.05 animations:^{myCircle.center = CGPointMake(myCircle.center.x+d, myCircle.center.yd);} completion:^(BOOL finished){ [UIView animateWithDuration:0.05 animations:^{myCircle.center = CGPointMake(myCircle.center.xd, myCircle.center.y+d);} ]; } ]; //... to here the code will build. } ]; } ]; } 

请注意,如果我注释掉animation代码的最后五行,一切编译好….发生了什么事情?

我试图切换到不同的编译器,这是行不通的。 我确定只有一个myCircle ,而且它唯一被引用的时间是它被声明的时间,在这个方法中!

这是一个小小的解决方法,通过对函数的recursion调用来解决问题。 然后,分配给震动量

 int d = 3; -(IBAction)shakeMyCircle{ [UIView animateWithDuration:0.05 animations:^{myCircle.center = CGPointMake(myCircle.center.x+3, myCircle.center.y-3);} completion:^(BOOL finished){ [UIView animateWithDuration:0.05 animations:^{myCircle.center = CGPointMake(myCircle.center.x-3, myCircle.center.y+3);} completion:^(BOOL finished) { d--; if(d>0) [self shakemyCircle]; if(d == 0) d = 3; } ]; } ]; }