Reputation: 489
I face trouble using po/p command in xcode using swift. It doesn't work always and gives error most of the time. Also its response is not useful most of the time. For example, when i type "po user" it gives instead of its details and items which i could expand while using objective-c
How do you debug any breakpoint? Are there any great external tools or alternatives available for this?
Upvotes: 1
Views: 130
Reputation: 43
Having the same problem with Xcode 6 to 7.1.1. Here is a workaround until the gets bug fixed:
Use the p command instead. If this doesnt work then do "step into" before you type the p command.
p yourvariable.yourparameter
Reference this:
https://stackoverflow.com/a/28841849/4144106
Upvotes: 0
Reputation: 23872
po
command works in swift too
po yourvariable.description
po yourvariable.debugDescription
or
po print(yourvariable)
Upvotes: 4