内部编译器错误:总线错误
我有以下代码(见下文),如果我编译它是因为我得到“内部编译器错误:总线错误”。 如果我注释掉最后一个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];
}];
}];
}
为什么你要嵌套另一个块,而不是仅仅添加
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);
希望这可以帮助。 :)
链接地址: http://www.djcxy.com/p/35367.html