Skip to content

Instantly share code, notes, and snippets.

@michaelochs
Created November 23, 2013 13:24
Show Gist options
  • Save michaelochs/7614557 to your computer and use it in GitHub Desktop.
Save michaelochs/7614557 to your computer and use it in GitHub Desktop.
If you add this content to your ~/.lldbinit you can launch the Reveal library from within your debugger as long as you have the library added to your app bundle. For more info please see my blog post: http://ios-coding.com/improved-way-to-integrate-reveal/
command alias reveal_load expr (void*)dlopen([(NSString*)[(NSBundle*)[NSBundle mainBundle] pathForResource:@"libReveal" ofType:@"dylib"] cStringUsingEncoding:0x4], 0x2);
command alias reveal_start expr (void)[(NSNotificationCenter*)[NSNotificationCenter defaultCenter] postNotificationName:@"IBARevealRequestStart" object:nil];
command alias reveal_stop expr (void)[(NSNotificationCenter*)[NSNotificationCenter defaultCenter] postNotificationName:@"IBARevealRequestStop" object:nil];
@forgot
Copy link

forgot commented Apr 2, 2014

With ARC enabled, I had to add a second cast to NSString, changing the first line to

command alias reveal_load expr (void*)dlopen((NSString*)[(NSString*)[(NSBundle*)[NSBundle mainBundle] pathForResource:@"libReveal" ofType:@"dylib"] cStringUsingEncoding:0x4], 0x2);

Not very experience with this, and it took me a while to get it right, so I'm commenting in case anyone else has the same problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment