【发布时间】:2018-03-07 06:48:40
【问题描述】:
我的应用程序在 iPhone6 上运行良好,但是当我在 iPhone7 上测试它时,当我尝试将点调整到图像时它崩溃了。
致命异常:CALayerInvalidGeometry CALayer位置包含NaN:[nan nan]
- (void)adjustPointsToFaceModel {
FaceFeatures *features = self.faceFeaturesModel.features;
CGRect featurePointsBox = [self.view featuresBoundingBox];
[self.view.featurePointsMapping enumerateKeysAndObjectsUsingBlock:^(NSNumber* key, FeaturePointView* view, BOOL *stop) {
FaceFeaturePoint feature = key.unsignedIntegerValue;
CGPoint pointCenter = [self.view convertPointFromImage:[features coordinatePointForFeature:feature]];
if (pointCenter.x < CGRectGetMinX(featurePointsBox)) {
pointCenter.x = CGRectGetMinX(featurePointsBox);
}
if (pointCenter.y < CGRectGetMinY(featurePointsBox)) {
pointCenter.y = CGRectGetMinY(featurePointsBox);
}
if (pointCenter.x > CGRectGetMaxX(featurePointsBox)) {
pointCenter.x = CGRectGetMaxX(featurePointsBox);
}
if (pointCenter.y > CGRectGetMaxY(featurePointsBox)) {
pointCenter.y = CGRectGetMaxY(featurePointsBox);
}
view.center = pointCenter;
}];
[self.view layoutIfNeeded];
}
XCode 说
最后一个异常回溯 (0)
在
[self.view.featurePointsMapping enumerateKeysAndObjectsUsingBlock:^(NSNumber* key, EMFeaturePointView* view, BOOL *stop) {
为此花费了数周时间。欢迎任何帮助!
【问题讨论】:
-
这个帖子可能会有所帮助:stackoverflow.com/questions/4867968/…
标签: ios objective-c xcode crash