Xcode 디버거는 객체를 인쇄하지 않고 nil을 표시합니다.
Xcode는를 사용하여 개체를 인쇄하려고 할 때 오류가 po <objectName>있지만 하나의 프로젝트에만 표시됩니다.
오류 : 구조체를 구체화 할 수 없습니다 : 변수 <varName>의 크기가 ValueObject의 크기와 일치하지 않습니다. 실행에서 오류가 발생하여 PrepareToExecuteJITExpression을 수행 할 수 없습니다
Xcode 디버거는 모든 객체 가 그렇지 않을 때 nil( self제외됨) NSLog으로 표시합니다 (이미지에 표시된대로 올바른 출력을 표시 함). 프로젝트에 어떤 문제가 있는지 모르겠습니다. 다른 모든 프로젝트는 잘 작동합니다.
그것이 무엇인지 알 수 있습니까? (프로젝트를 청소해도 효과가 없습니다.)
"릴리즈 모드"에 있지 않습니까?
변수 값을 보려면 "디버그 모드"에 있어야합니다 (시작 / 중지 버튼 근처의 왼쪽 상단 모서리에서 프로젝트 이름을 클릭 한 다음 "구성표 편집 ...", "실행"설정, " 정보 "탭을 클릭 한 다음"빌드 구성 "을 선택합니다. 여기에서"디버그 "를 설정합니다."릴리스 "에있는 경우 모든 문제가 발생했습니다.)
디버그 구성에 대한 "최적화 수준"을 "없음"으로 설정하고 문제를 해결했습니다.
구성표 설정에서 Address Sanitizer가 꺼져 있는지 확인하십시오. Address Sanitizer는 디버거에서 제대로 작동하지 않습니다.
- 구성표 편집 (제품 >> 구성표 >> 구성표 편집)으로 이동하여 실행을 선택한 다음 진단 탭으로 이동하십시오.
- "Address Sanitizer 활성화"가 꺼져 있는지 확인하십시오.
모두 자신의 솔루션을 가지고있는 것 같습니다.
For me, I use Objective-C and Swift at the same time.
First of all, go to TARGETS -> Build Settings and search the code generation
You’ll find Apple LLVM 6.0 and Swift Compiler
Change their Optimization Level all to None, then Debug, you may find the value not nil
Amazingly once you can see the value, you solve this problem permanently, then you can change the Optimization Level to it used to be.
There are other ways this can occur. For me it was because the "Other C Flags" value was set to "-O2", even for the debug build. Turning this off for the debug build resolved the issue.
For me, Xcode was filtering out the debugger output. Make sure your output setting is Debugger Output or All Output
I just encountered this issue and found that it was because Deployment Postprocessing = YES in the Build Settings.
Changing this to NO fixed it, as seen in the screenshot below:

Xcode version: 6.0.1 (6A317) on OSX 10.9.5
I just run into a similar problem: At one point suddenly the Xcode debugger printed out some object types especially NSStrings as (null) although they were initialized with a value. Printed out via
NSLog(@"String value: %@", myString);
the correct value for the object was shown.
Confusing! Solving the problem was rather easy: I just shut down Xcode and restarted my computer. After I restarted Xcode everything works fine again :).
Make sure Link-Time Optimization = No for debug mode in Build Settings.
- Delete Derived Data
- Quite Xcode / Restart
- Clean Project
That's all it took for me.
The solutions here will also fix the bug where you see error: <EXPR>:1:1: error: use of unresolved identifier every time you try to po a variable.
For me the solution was to go to Build Settings and search for Optimization Level and make sure each Debug setting was set to None.
Go to "Other C Flags" in build setting and set debug value from -o2 to -O0
I have run into this as well and when I found I was in release mode I switch to debug ... no fix. Turns out that I had to do a clean first (cmd+shift+k).
So I think what happens is that after built in release mode not everything is recompiled in develop and so lldb can't properly read the symbols. After cleaning and recompiling in develop it worked for me.
The reality is that the system should work out of the box and doesn't due to links to a multiple quantity of different settings, to a point that things may work for you, or not.
Why doesn't the system allows always to debug when in debug mode is a mystery that only Apple can answer (if they cared, which latelly i doubt they do).
After all, the difference between debug / non-debug would be extra tables with metadata which only fill in memory / disk space.
If you are compiling against the simulator or a device directly, you will not care of those extra megabytes.
So we need to run extra loops to just do a very basic and plain thing that all ides that i know since last century do just fine.
And to add, for me what worked was changing on "Debug" the Link-Time Optimization from "Monolithic" to "No" (xcode 8).
'Programming' 카테고리의 다른 글
| Rails 3.1 및 이미지 자산 (0) | 2020.06.05 |
|---|---|
| 직접 대 위임-jQuery .on () (0) | 2020.06.05 |
| ASP.NET의 세션 시간 초과 (0) | 2020.06.05 |
| 더 이상 존재하지 않는 원격 분기를 표시하는 'git branch -av' (0) | 2020.06.05 |
| 메모장에서 개행 문자를 선택하십시오 ++ (0) | 2020.06.04 |


