CG_CONTECT_SHOW_BACKTRACE 환경변수는 어떻게 설정할 수 있습니까?
제 시야에는 세 개의 버튼이 있습니다.DidLoad() 보기에서 Radus 모서리를 설정한 후:button.layer.cornerRadius = 20
로그에 다음 오류 메시지가 나타납니다.
<Error>: CGContextSaveGState: invalid context 0x0.
If you want to see the backtrace, please set
CG_CONTEXT_SHOW_BACKTRACE environmental variable.
질문:
-
CG_CONTECT_SHOW_BACKTRACE 환경변수는 어떻게 설정할 수 있습니까? - 아니면 이 경고를 어떻게 수정할 수 있습니까?
네, 지금 메시지에서 역추적을 해봤습니다.저는 전혀 이해가 안 돼요.제발 좀 도와주세요...
Aug 7 14:27:00 <Error>: CGContextSaveGState: invalid context 0x0. Backtrace:
<-[UIStatusBarItemView updateContentsAndWidth]+33>
<-[UIStatusBarItemView initWithItem:data:actions:style:]+477>
<+[UIStatusBarItemView createViewForItem:withData:actions:foregroundStyle:]+134>
<-[UIStatusBarLayoutManager _createViewForItem:withData:actions:]+163>
<-[UIStatusBarLayoutManager _prepareEnabledItemType:withEnabledItems:withData:actions:itemAppearing:itemDisappearing:]+36
<-[UIStatusBarLayoutManager prepareEnabledItems:withData:actions:]+92>
<-[UIStatusBarForegroundView _setStatusBarData:actions:animated:]+797>
<-[UIStatusBarForegroundView setStatusBarData:actions:animated:]+332>
<__51-[UIStatusBar _prepareToSetStyle:animation:forced:]_block_invoke+360>
<+[UIView(Animation) performWithoutAnimation:]+65>
<-[UIStatusBar _prepareToSetStyle:animation:forced:]+866>
<-[UIStatusBar _requestStyleAttributes:animationParameters:forced:]+391>
<-[UIStatusBar requestStyle:animationParameters:forced:]+437>
<-[UIStatusBar requestStyle:animated:forced:]+90>
<-[UIStatusBar _evaluateServerRegistration]+250>
<__45-[UIView(Hierarchy) _postMovedFromSuperview:]_block_invoke+590>
<-[UIView(Hierarchy) _postMovedFromSuperview:]+544>
<-[UIView(Internal) _addSubview:positioned:relativeTo:]+1967>
<-[UIStatusBarWindow setStatusBar:]+288>
<-[UIApplication _createStatusBarWithRequestedStyle:orientation:hidden:]+340>
<-[UIApplication _runWithMainScene:transitionContext:completion:]+950>
<-[UIApplication workspaceDidEndTransaction:]+188>
<-[FBSSerialQueue _performNext]+192>
<-[FBSSerialQueue _performNextFromRunLoopSource]+45>
<__CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__+17>
<__CFRunLoopDoSources0+556>
<__CFRunLoopRun+867>
<CFRunLoopRunSpecific+488>
<-[UIApplication _run]+402>
<UIApplicationMain+171>
<main+117>
Aug 7 14:27:00 <Error>: CGContextTranslateCTM: invalid context 0x0. Backtrace:
<-[UIStatusBarItemView updateContentsAndWidth]+33>
<-[UIStatusBarItemView initWithItem:data:actions:style:]+477>
<+[UIStatusBarItemView createViewForItem:withData:actions:foregroundStyle:]+134>
<-[UIStatusBarLayoutManager _createViewForItem:withData:actions:]+163>
<-[UIStatusBarLayoutManager _prepareEnabledItemType:withEnabledItems:withData:actions:itemAppearing:itemDisappearing:]+36
<-[UIStatusBarLayoutManager prepareEnabledItems:withData:actions:]+92>
<-[UIStatusBarForegroundView _setStatusBarData:actions:animated:]+797>
<-[UIStatusBarForegroundView setStatusBarData:actions:animated:]+332>
<__51-[UIStatusBar _prepareToSetStyle:animation:forced:]_block_invoke+360>
<+[UIView(Animation) performWithoutAnimation:]+65>
<-[UIStatusBar _prepareToSetStyle:animation:forced:]+866>
<-[UIStatusBar _requestStyleAttributes:animationParameters:forced:]+391>
<-[UIStatusBar requestStyle:animationParameters:forced:]+437>
<-[UIStatusBar requestStyle:animated:forced:]+90>
<-[UIStatusBar _evaluateServerRegistration]+250>
<__45-[UIView(Hierarchy) _postMovedFromSuperview:]_block_invoke+590>
<-[UIView(Hierarchy) _postMovedFromSuperview:]+544>
<-[UIView(Internal) _addSubview:positioned:relativeTo:]+1967>
<-[UIStatusBarWindow setStatusBar:]+288>
<-[UIApplication _createStatusBarWithRequestedStyle:orientation:hidden:]+340>
<-[UIApplication _runWithMainScene:transitionContext:completion:]+950>
<-[UIApplication workspaceDidEndTransaction:]+188>
<-[FBSSerialQueue _performNext]+192>
<-[FBSSerialQueue _performNextFromRunLoopSource]+45>
<__CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__+17>
<__CFRunLoopDoSources0+556>
<__CFRunLoopRun+867>
<CFRunLoopRunSpecific+488>
<-[UIApplication _run]+402>
<UIApplicationMain+171>
<main+117>
Aug 7 14:27:00 <Error>: CGContextRestoreGState: invalid context 0x0. Backtrace:
<-[UIStatusBarItemView updateContentsAndWidth]+33>
<-[UIStatusBarItemView initWithItem:data:actions:style:]+477>
<+[UIStatusBarItemView createViewForItem:withData:actions:foregroundStyle:]+134>
<-[UIStatusBarLayoutManager _createViewForItem:withData:actions:]+163>
<-[UIStatusBarLayoutManager _prepareEnabledItemType:withEnabledItems:withData:actions:itemAppearing:itemDisappearing:]+36
<-[UIStatusBarLayoutManager prepareEnabledItems:withData:actions:]+92>
<-[UIStatusBarForegroundView _setStatusBarData:actions:animated:]+797>
<-[UIStatusBarForegroundView setStatusBarData:actions:animated:]+332>
<__51-[UIStatusBar _prepareToSetStyle:animation:forced:]_block_invoke+360>
<+[UIView(Animation) performWithoutAnimation:]+65>
<-[UIStatusBar _prepareToSetStyle:animation:forced:]+866>
<-[UIStatusBar _requestStyleAttributes:animationParameters:forced:]+391>
<-[UIStatusBar requestStyle:animationParameters:forced:]+437>
<-[UIStatusBar requestStyle:animated:forced:]+90>
<-[UIStatusBar _evaluateServerRegistration]+250>
<__45-[UIView(Hierarchy) _postMovedFromSuperview:]_block_invoke+590>
<-[UIView(Hierarchy) _postMovedFromSuperview:]+544>
<-[UIView(Internal) _addSubview:positioned:relativeTo:]+1967>
<-[UIStatusBarWindow setStatusBar:]+288>
<-[UIApplication _createStatusBarWithRequestedStyle:orientation:hidden:]+340>
<-[UIApplication _runWithMainScene:transitionContext:completion:]+950>
<-[UIApplication workspaceDidEndTransaction:]+188>
<-[FBSSerialQueue _performNext]+192>
<-[FBSSerialQueue _performNextFromRunLoopSource]+45>
<__CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__+17>
<__CFRunLoopDoSources0+556>
<__CFRunLoopRun+867>
<CFRunLoopRunSpecific+488>
<-[UIApplication _run]+402>
<UIApplicationMain+171>
<main+117>
제품 -> 스킴 -> 스킴 편집 스킴의 이 메뉴를 통해 환경 변수를 설정할 수 있습니다."실행" 항목에서 "인수" 탭을 찾으면 탭에 "환경 변수"가 표시됩니다. 추가CG_CONTEXT_SHOW_BACKTRACE
값을 YES로 설정합니다.
9b5에 있는 버그입니다.
https://forums.developer.apple.com/thread/13683
애플에 레이더를 설치합니다.
이 문제는 Xcode 7에서 발생합니다.제 경우에는 제가 제거한 것은UIViewControllerBasedStatusBarAppearance
부터Info.plist
문제가 해결되었답니다!다음 게시물에서 답변 보기:
Xcode 7의 경우:
상태 표시줄을 숨기려면 변경하십시오.UIViewControllerBasedStatusBarAppearance
에서Info.plist
줄로 늘어놓다View controller-based status bar appearance
. 잊지 말고 다음과 같이 하십시오.NO
언급URL : https://stackoverflow.com/questions/31872650/how-can-i-set-cg-context-show-backtrace-environmental-variable
'programing' 카테고리의 다른 글
MySQL 데이터베이스에 DECIAL을 삽입하는 방법 (0) | 2023.09.28 |
---|---|
최대 절전 모드 트랜잭션 관리자 또는 Jpa 트랜잭션 관리자 (0) | 2023.09.28 |
AngularJS로 1초마다 카운트다운하는 메시지를 표시하려면 어떻게 해야 합니까? (0) | 2023.09.28 |
MySQL의 ANSI 드라이버와 유니코드 드라이버의 차이 (0) | 2023.09.28 |
배열을 JavaScript에서 별도의 변수로 압축 풀기 (0) | 2023.09.28 |