Four years later (2020) this is a different problem with a different fix (at least in my experience).
I work almost entirely in Objective-C, writing apps for iOS. For years I've had the command
saved as a user breakpoint so that when Xcode threw an exception it would print the exception message to its console.
At some point after I began using Xcode 11, this started failing with the message
Code Block Stopped due to an error evaluating condition of breakpoint 1.1: "po $arg1" |
Couldn't parse conditional expression: |
error: use of undeclared identifier 'po' |
After a fresh dive into the Googleverse today, I stumbled upon an answer.
Xcode 11's debugger stops with its stack-view selection on the line of my code that threw the exception
Code Block [self.termsVC.presentingVC presentViewController:nav animated:YES completion:nil]; |
Here 'po $arg1' fails as I've described (for me).
If I select the top line in the stack view (in the exception code, where the debugger is actually stopped)
Code Block objc_exception_throw |
and repeat the command, it works as before
Code Block (lldb) po $arg1 |
The specified modal presentation style doesn't have a corresponding presentation controller. |
Yet Xcode's stack view was always selecting my code, not the exception code. That hasn't changed. What changed was Xcode 11's ability to evaluate "po $arg1" from that line.
Details: MacBook Pro (13-inch 2019), 16GB RAM, macOS Mojave 10.14.6, Xcode 11.3.1. Both iOS Simulator and devices.
Happens both in new projects created with Xcode 11 and older projects created with Xcode 9 and earlier. Was happening in earlier versions of Xcode 11 and in earlier versions of Mojave. Not yet tested in Catalina.