Chapter 1, Swift vs Objective-C Debugging expression issue

I followed this example as written and ran into an issue, but I believe I found the cause. The correct command appears to be expr -l swift -- import Foundation, not ex -l swift -- import Foundation as shown in the book. If I missed this clarification elsewhere, I apologize.

You’re right — it’s a typo in the book. The correct command is:

expr -l swift -- import Foundation

Using ex -l swift won’t work because expr is required to evaluate Swift expressions in LLDB. This isn’t clarified elsewhere in the chapter.

1 Like