반응형
Xcode의 디버그 콘솔 출력에서 자동 레이아웃 제약 조건 오류 메시지 비활성화
자동 레이아웃 오류 / 경고 메시지를 (일시적으로) 비활성화하는 방법이 있습니까?
Unable to simultaneously satisfy constraints.
Probably at least one of the constraints in the following list is one you don't want. Try this: (1) look at each constraint and try to figure out which you don't expect; (2) find the code that added the unwanted constraint or constraints and fix it. (Note: If you're seeing NSAutoresizingMaskLayoutConstraints that you don't understand, refer to the documentation for the UIView property translatesAutoresizingMaskIntoConstraints)
(
"<NSLayoutConstraint:0x170098420 H:[UIView:0x15c62c100(2)]>",
"<NSLayoutConstraint:0x170098600 UIView:0x15c6294f0.leading == UIView:0x15c628d40.leadingMargin - 8>",
"<NSLayoutConstraint:0x170098650 H:[UIView:0x15c6294f0]-(0)-[UIView:0x15c62b750]>",
"<NSLayoutConstraint:0x1700986a0 UIView:0x15c62b750.width == UIView:0x15c6294f0.width>",
"<NSLayoutConstraint:0x1700986f0 UIView:0x15c628d40.trailingMargin == UIView:0x15c62b750.trailing - 8>",
"<NSLayoutConstraint:0x170098880 H:[UIView:0x15c6294f0]-(0)-[UIView:0x15c62c100]>",
"<NSLayoutConstraint:0x1700988d0 UIView:0x15c628d40.centerX == UIView:0x15c62c100.centerX + 1>"
)
Will attempt to recover by breaking constraint
<NSLayoutConstraint:0x170098420 H:[UIView:0x15c62c100(2)]>
Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger.
The methods in the UIConstraintBasedLayoutDebugging category on UIView listed in <UIKit/UIView.h> may also be helpful.
일부 디 컴파일을했고 실제로 방법이 있습니다.
Swift 3 용
UserDefaults.standard.setValue(false, forKey: "_UIConstraintBasedLayoutLogUnsatisfiable")
목표 -C
[[NSUserDefaults standardUserDefaults] setValue:@(NO) forKey:@"_UIConstraintBasedLayoutLogUnsatisfiable"];
이제 "_UIConstraintBasedLayoutLogUnsatisfiable이 OFF"라는 알림 만 받게됩니다.
이 글을 읽는 모든 사람을위한 필수 알림 : 이것이 최후의 수단이되어야합니다. 제약 문제를 디버깅하고 수정하는 방법은 WWDC의 "Mysteries of Auto Layout"세션 : 파트 1 및 파트 2를 참조하십시오 .
Swift 3.0 솔루션 :
//Hide Autolayout Warning
UserDefaults.standard.setValue(false, forKey:"_UIConstraintBasedLayoutLogUnsatisfiable")
AppKit / Cocoa로 macOS / osx를 수행하는 방법을 궁금해하는 모든 사용자
UserDefaults.standard.set(false, forKey: "NSConstraintBasedLayoutLogUnsatisfiable")
UserDefaults.standard.set(false, forKey: "__NSConstraintBasedLayoutLogUnsatisfiable")
나는 lldb를 사용하여 이것을 해결하려고 시도했고 해결책을 찾았습니다.
- 모듈 UIKit에서 기호 UIViewAlertForUnsatisfiableConstraints에 대한 기호 중단 점을 작성하십시오.
- 중단 점 작업으로 "thread return"디버거 명령을 추가합니다.
- 두 번째 디버거 명령 추가 : "c"
- "작업 평가 후 자동으로 계속"비활성화
앱에 레이아웃 문제가 발생하면 실행이 일시 중지됩니다. "thread return"명령을 사용하면 경고 메시지가 콘솔에 인쇄되기 전에 오류를 출력하는 UIViewAlertForUnsatisfiableConstraints 함수가 강제로 반환됩니다.
"c"명령을 사용하면 앱 실행이 계속됩니다 (참고 : "작업을 평가 한 후 자동으로 계속"은이 경우 어떻게 든 작동하지 않습니다).
그러나 이러한 자동 작업을 사용하면 중단 점이 두 번 맞으면 이상하게 동작 할 수 있습니다. 앱이 다운되는 행입니다. 이를 해결하기 위해 중단 점 작업을 제거하고 디버거가 프로그램 실행을 일시 중지 할 때 수동으로 명령을 입력 할 수 있습니다.
반응형
'programing tip' 카테고리의 다른 글
AngularJS를 사용하여 JSON 피드에서 선택 드롭 다운 목록을 어떻게 채울 수 있습니까? (0) | 2020.11.26 |
---|---|
2015 년 4 월 20 일 이후 (v3 API없이) Youtube 채널 RSS 피드를받는 방법은 무엇입니까? (0) | 2020.11.26 |
Internet Explorer는 CSS 전환을 지원합니까? (0) | 2020.11.26 |
"em"을 사용한 글꼴 크기 조정은 여전히 관련이 있습니까? (0) | 2020.11.25 |
git“스냅 샷”이란 무엇입니까? (0) | 2020.11.25 |