Search code examples
iosxcodelldbnsundomanager

Xcode LLDB Print Statements Fail - NSUndoManager


I have a breakpoint set and want to print my UITextField's superview. I type po myTextField.superview but I receive the following error:

error: instance method 'undoManager' has incompatible result types in different translation units ('id' vs. 'NSUndoManager *')
note: instance method 'undoManager' also declared here
error: 1 errors parsing expression

What does this mean and how can I print my superview? I found a link that provides a janky workaround in code: http://openradar.io/15890965, but I would like a better solution.


Solution

  • People of the world: I have an answer!

    To dodge all UIKit errors: Before typing your po statement, type the line -- expr @import UIKit

    If you want to turn this on for your app globally, then add the following breakpoint in your app delegate:

    enter image description here

    Thanks to Craig Hockenberry and Steve Streza for the update (found here).