Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode 8 does not show any value of variable when i place on it in debug

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.

like image 944
Yucel Bayram Avatar asked Oct 07 '16 08:10

Yucel Bayram


People also ask

How do I show variables in debug mode?

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.

How do I show variables in Xcode?

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.

How do I print a variable in Xcode?

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.


1 Answers

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.

like image 61
Jim Ingham Avatar answered Oct 20 '22 23:10

Jim Ingham