Any tricks to use QuickLook debugging on a struct (or enum)?

So Xcode has a handy "quick look" feature, it can visualize NSBezierPaths, UIImages, NSAttributedStrings and a bunch more Apple supplied classes. It will also visualize anything you have an @objc debugQuickLookObject() -> AnyObject (and AnyObject needs to be one of like a dozen+ things when you return it)...but you can only add that to a class, not a struct or enum (or I'm missing a trick!)

So far my not-very convent workaround is to have a method with a short name and then manually "add expression" to the local variables view and then get a QL on the expression. It is less then convenient, but does work.

Does anyone have suggestions on how to more directly get a quicklook either from the lldb command prompt, or to make Xcode recognize the "quicklookness" of a value type?


Thanks for asking the question. I'm looking for the answer too and in the meantime the "add expresssion" trick you described helped me a lot.

1 Like

I wish someone from Apple would answer this, but in the meantime you could maybe create an @objc wrapper class just for the purpose of quicklook'ing.

1 Like
Terms of Service

Privacy Policy

Cookie Policy