Create a gist now

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Implementation of doSome:for:, ripe for disassembly. Look at the disassembly of main() for the calls to objc_msgSend.
#import <Foundation/Foundation.h>
// clang -g -Wall -framework Foundation -o someObject someObject.m
@interface SomeObject : NSObject
- (void) doSome: (id) stuff for: (id) reasons;
@end // SomeObject
@implementation SomeObject
- (void) doSome: (id) stuff for: (id) reasons {
NSLog (@"Did some %@ for %@", stuff, reasons);
} // doSome
@end // SomeObject
int main (void) {
@autoreleasepool {
SomeObject *obj = [[SomeObject alloc] init];
[obj doSome: @"stuff" for: @"reasons"];
}
return 0;
} // main
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment