繁体   English   中英

用Swift3.0升级Xcode8?

[英]Upgrade Xcode8 with Swift3.0?

最近,我已将我的Xcode升级到版本8,我的控制台中出现了一些奇怪的错误,如下所示:

Painter Z index: 1023 is too large (max 255)
Painter Z index: 1023 is too large (max 255)
Painter Z index: 1023 is too large (max 255)
Painter Z index: 1023 is too large (max 255)
Painter Z index: 1023 is too large (max 255)    
ERROR /BuildRoot/Library/Caches/com.apple.xbs/Sources/VectorKit_Sim/VectorKit-1228.30.7.17.9/GeoGL/GeoGL/GLCoreContext.cpp 1763: InfoLog SolidRibbonShader:
ERROR /BuildRoot/Library/Caches/com.apple.xbs/Sources/VectorKit_Sim/VectorKit-1228.30.7.17.9/GeoGL/GeoGL/GLCoreContext.cpp 1764: WARNING: Output of vertex shader 'v_gradient' not read by fragment shader

任何专家都知道如何处理它?

先谢谢你。

冻结问题仅在从Xcode 8.0运行时才会发生,并且仅在iOS 10上运行,无论是在调试模式还是在发布模式下。 当应用程序通过App Store或第三方ad hoc分发系统分发时,MKMapView似乎很好。 我不知道你看到的警告可能与问题有关,也可能没有。

我发现有问题的代码是在MKMapView的析构函数中,你使用地图视图对象或者如何配置它无关紧要,即只是调用

#ViewController.h
@property(nonatomic,strong)MKMapView *mapView;
@end

代码中的任何位置都会冻结应用。 主线程挂在信号量上,并不清楚为什么

注意:这是一个非常简单的解决方法,但至少它可以帮助您调试您的应用程序而不会冻结。 保留这些对象意味着每次使用地图创建视图控制器时,内存使用量将增加约45-50MB。

所以,假设您有一个属性mapView,那么您可以在视图控制器的dealloc中执行此操作:

#ViewController.m
@interface ViewController ()
{

}
@end
@implementation ViewController


//the freezing problem happens only when run from Xcode 8.0
- (void)dealloc
{
#if DEBUG
// Xcode8/iOS10 MKMapView bug workaround
static NSMutableArray* unusedObjects;
if (!unusedObjects)
    unusedObjects = [NSMutableArray new];
[unusedObjects addObject:mapView];
#endif
}

@end

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM