Inspecting custom views and messaging objects

Reveal's inspectors allow you to view and edit values for many of the common view classes in UIKit, but don't yet allow you to inspect custom UIView subclass properties or send arbitrary messages to objects in your running application.

Using the object's address however, which is displayed in Reveal's identity inspector, you can easily message your views in the Xcode debugger.

First, select the view you wish to message in the outline or graphical canvas. Next, select the identity inspector (second tab from the left). The 'Address' property contains the memory address of the view in your running application.

Getprice__iPhone_Simulator_.png

Getprice__iPhone_Simulator_.png

Switching to the Xcode debugger, pause your application or set a breakpoint, and you'll be able to message this object by using the debugger to evaluate expressions.

Screen_Shot_2013-09-06_at_3.09.25_PM.png

(lldb) po 0x13481d80
$0 = 323493248 <GPOfferCell: 0x13481d80; baseClass = UITableViewCell; frame = (0 326; 320 75); autoresize = W; layer = <CALayer: 0x134876c0>>
(lldb) p (BOOL)[0x13481d80 isEnabled]
(BOOL) $1 = YES
(lldb) expr (void)[0x13481d80 setEnabled:(BOOL)0]
(lldb) p (BOOL)[0x13481d80 isEnabled]
(BOOL) $2 = NO
(lldb) po [0x13481d80 nextResponder]
$3 = 0x0bb7cc00 <UITableView: 0xbb7cc00; frame = (0 0; 320 416); clipsToBounds = YES; autoresize = W+H; gestureRecognizers = <NSArray: 0xaecbf70>; layer = <CALayer: 0xae78680>; contentOffset: {0, 0}>
(lldb)

You can also make life easier for yourself by overriding the -(NSString *) description method on your custom view class to print whatever information you like about the object.