In Debug Mode i am trying to see values of variables but it shows nothing. I use Xcode8
. Using Objective - C
and Swift
classes together. I dont have such problem in objective-C
part, i can see values clearly. I read lots of posts and answers but none of them helped me. I tried to set optimization level = none under Swift
compiler in BuildSettings
. Also tried adding o2 and -O0 to other linker flags
. I checked edit scheme and it is in debug mode. So i stuck. By the way if i create project with only swift language, i can see values of variables. Thanks in advance.
The most commonly used way to look at variables is the DataTip. When stopped in the debugger hover the mouse cursor over the variable you want to look at. The DataTip will appear showing you the value of that variable.
When you find your variable, right-click on it and choose “Watch”. Once that's done you can continue your program as normal, and anywhere the variable is read from or written to Xcode will pause and you can use the debug navigator to step through the call stack to figure out what happened.
Print a variableClick the Add Action button and select Debugger Command. Put any print command in a debug console in a text field. Make sure you prefix it with po , e.g., po print(view) . Check Automatically continue after evaluating actions.
The first thing to check when you have problems with a new version of Xcode is to make sure that you rebuild all the Swift code (your own and anything you are importing from Carthage or CocoaPods) with the new tools.
If that doesn't help, it is probably best to file a bug with http://bugreporter.apple.com; it will probably take some back and forth to figure out what's going wrong and a bug report is a more convenient way to do that.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With