1

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?

2
  • 2
    po will work in swift Commented Jul 28, 2015 at 7:29
  • it doesn't work always.. It gives error most of the time. Although it's working now, but when i type "po user" it gives <User: 0x7fa11bcaa100> instead of its details and items which i could expand while using objective-c Commented Jul 28, 2015 at 7:42

2 Answers 2

4

po command works in swift too

po yourvariable.description
po yourvariable.debugDescription

or

po print(yourvariable)
Sign up to request clarification or add additional context in comments.

3 Comments

it doesn't work always.. It gives error most of the time. Although it's working now, but when i type "po user" it gives <User: 0x7fa11bcaa100> instead of its details and items which i could expand while using objective-c
@avnishkgaur the user is may be an object you have to catch values from it like user.name etc. Try to check it.
I am getting this error when i log a variable: error: Error in auto-import: failed to get module 'xxxxxx' from AST context: some pod files are mentioned A fatal parse error has occurred. LLDB may become unstable; please restart your debug session as soon as possible.
0

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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.