Skip to content

Instantly share code, notes, and snippets.

@boredzo
Created January 1, 2012 23:09
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 boredzo/1548608 to your computer and use it in GitHub Desktop.
Save boredzo/1548608 to your computer and use it in GitHub Desktop.
#import <Foundation/Foundation.h>
@interface Foo: NSObject
- (void) takeBool:(BOOL)yorn;
- (void) takeDouble:(double)d;
@end
int main(int argc, char **argv) {
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
[[[[Foo alloc] init] autorelease] performSelector:@selector(takeBool:) withObject:[NSNumber numberWithBool:NO]];
[[[[Foo alloc] init] autorelease] performSelector:@selector(takeDouble:) withObject:[NSNumber numberWithDouble:17000.43]];
[pool release];
return EXIT_SUCCESS;
}
@implementation Foo
- (void) takeBool:(BOOL)yorn {
NSLog(@"Bool value: %hhd", (BOOL)yorn);
}
- (void) takeDouble:(double)d {
NSLog(@"Double value: %g", d);
}
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment