unable to print object ('po') in xcode6 beta 6 osx swift project: (Error in auto-import: failed to get module '__ObjC' from AST context)

Maxim Volgin picture Maxim Volgin · Aug 27, 2014 · Viewed 9.4k times · Source

An attempt to print object (po command) in xcode 6 beta 6 OSX Swift project results in this error message:

(lldb) po managedObject
error: Error in auto-import:
failed to get module '__ObjC' from AST context

In this case the object in question is an instance of NSManagedObject.

Any advice on how to help auto-import in getting __ObjC module into LLVM Abstract Syntax Tree context?

Answer

Robert Wagstaff picture Robert Wagstaff · Nov 6, 2014

As of Xcode 6.1 if you attempt the po command twice it will work on the second attempt. The first po command will always fail for each new debugging session but subsequent calls work.