Skip to content

Instantly share code, notes, and snippets.

@fabiosoft
Created May 4, 2022 13:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fabiosoft/8b107337c3dea5056be46e1d23b552d0 to your computer and use it in GitHub Desktop.
Save fabiosoft/8b107337c3dea5056be46e1d23b552d0 to your computer and use it in GitHub Desktop.
Get all methods of an Objective-C class or instance
// Either in lldb:
(lldb) po [self _methodDescription]
//or in code:
@interface NSObject (Private)
- (NSString*)_methodDescription;
@end
// Somewhere in the code:
NSLog(@"%@", [objectToInspect performSelector:@selector(_methodDescription)]);
//**
Output will look as following:
<__NSArrayM: 0x7f9 ddc4359a0>:
in __NSArrayM:
Class Methods:
+ (BOOL) automaticallyNotifiesObserversForKey:(id)arg1; (0x11503b510)
+ (id) allocWithZone:(_NSZone*)arg1; (0x11503b520)
+ (id) __new:::::(const id*)arg1; (0x114f0d700)
Instance Methods:
- (void) removeLastObject; (0x114f669a0)
- (void) dealloc; (0x114f2a8f0)
- (void) finalize; (0x11503b2c0)
- (id) copyWithZone:(_NSZone*)arg1; (0x114f35500)
- (unsigned long) count; (0x114f0d920)
- (id) objectAtIndex:(unsigned long)arg1; (0x114f2a730)
- (void) getObjects:(id*)arg1 range:(_NSRange)arg2; (0x114f35650)
- (void) addObject:(id)arg1; (0x114f0d8e0)
- (void) setObject:(id)arg1 atIndex:(unsigned long)arg2; (0x114f99680)
- (void) insertObject:(id)arg1 atIndex:(unsigned long)arg2; (0x114f0d940)
- (void) exchangeObjectAtIndex:(unsigned long)arg1 withObjectAtIndex:(unsigned long)arg2; (0x114f8bf80)
......
in NSMutableArray:
Class Methods:
+ (id) copyNonRetainingArray; (0x11ee20178)
+ (id) nonRetainingArray; (0x11ee201e8)
+ (id) nonRetainingArray; (0x120475026)
+ (id) arrayWithCapacity:(unsigned long)arg1; (0x114f74280)
......
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment