每当我旋转一个有屏幕的屏幕时,我就会看到这种情况发生UITableView
.我发现它发生在willRotate
和我的同事之间的didRotate
方法调用之间UIViewController
也见过它在其他地方,通常在旋转周围.它直到最近才开始发生,我们对如何应对它感到困惑(谷歌搜索不会以错误的形式显示错误消息).有没有其他人遇到过这个知道怎么做的事情?
我已经看了很多,但我似乎只能获得与此问题相关的webView和表格.我的完全不同似乎与同样的崩溃异常:
CALayerInvalidGeometry',原因:'CALayer bounds包含NaN:[0 0; 南楠]
基本上我在这里有一个视图,淡化和缩放图像.我最近决定在UIView动画中使用CGAffineTransformScale更改我的代码,而不是每次计时器滴答时都缩放一个档次.这使用较少的处理能力.
但无论我有什么顺序,它都会在19世纪之后崩溃.它所引用的定位坐标数组似乎不是问题,因为它只有6个长度,并在达到其长度后循环.所以出于某些原因,因为我已经实现了这个动画代码,它让我崩溃了.谁知道为什么?
这是我开始崩溃后改变的部分:
-(void) onTimer{
if(scaleTimer_A==5){
imageView_A.image = [UIImage imageNamed:[attractList_A objectAtIndex:imageIndex_A]];
imageView_A.frame = CGRectMake(300, 200, 3.86, 3.86);
imageView_A.center = CGPointMake(attractLocs_x_A[attractLocs_A_index], attractLocs_y_A[attractLocs_A_index]);
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:2];
imageView_A.alpha = 1;
imageView_A.transform = CGAffineTransformScale(imageView_A.transform, 100, 100);
[UIView commitAnimations];
}
if(scaleTimer_A==10){
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:.75];
imageView_A.alpha = 0;
imageView_A.transform = CGAffineTransformScale(imageView_A.transform, 1.2, 1.2);
[UIView commitAnimations];
scaleTimer_A=0;
imageIndex_A+=1;
if(imageIndex_A==imageIndex_A_size){
imageIndex_A=0;
}
attractLocs_A_index+=1;
if(attractLocs_A_index==attractLocs_A_SIZE){
NSLog(@"Back to zero A");
attractLocs_A_index=0;
}
NSLog(@"Image A =%@", [attractList_A objectAtIndex:imageIndex_A]);
}
scaleTimer_A+=1;}
Run Code Online (Sandbox Code Playgroud)
编辑: …