justdan0227
justdan0227

Reputation: 1362

What changed in xcode7 debugger that I can no longer view variables with "po" / Swift

ok what changed in xCode7 / Swift that I can no longer use "po frame" to view the contents of a CGRect anylonger? The print statment works just fine in the code. How come I can't view that in the debugger console like I used to?

var frame = self.myLabel.frame

frame.origin.x = self.startingFrame.origin.x + translation.x
frame.origin.y = self.startingFrame.origin.y + translation.y

print(frame)

self.myLabel.frame = frame

yet in the debugger if I break on the self.myLabel.frame = frame statement and use po (or p or print) in the debugger I get:

(164.0, 323.0, 41.6666666666667, 20.3333333333333)
(lldb) po frame
error: <EXPR>:1:1: error: use of unresolved identifier 'frame'
frame
^~~~~
(lldb) p frame
error: <EXPR>:1:1: error: use of unresolved identifier 'frame'
frame
^~~~~
(lldb) print frame
error: <EXPR>:1:1: error: use of unresolved identifier 'frame'
frame
^~~~~
(lldb) 

Upvotes: 4

Views: 463

Answers (2)

Alan
Alan

Reputation: 138

I am still seeing this in Xcode 7.2 (using ObjC). Makes it very frustrating debugging layout code.

The debugger doesn't show the frame as an ivar of the views and type summaries won't print it. You have to 'po foo.frame' to see it.

Upvotes: 0

Jim Ingham
Jim Ingham

Reputation: 27110

This is a bug in Xcode 7.1. It is fixed in the current 7.2 beta, and will be fixed in the final. The bug is that the types for Structs imported from C/ObjC modules into Swift are not available to the debugger (and in turn it won't report variables whose types are unavailable.)

Upvotes: 3

Related Questions