簡體   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