Created
May 23, 2013 13:44
-
-
Save markd2/5636175 to your computer and use it in GitHub Desktop.
Implementation of doSome:for:, ripe for disassembly. Look at the disassembly of main() for the calls to objc_msgSend.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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