Created
January 1, 2012 23:09
-
-
Save boredzo/1548608 to your computer and use it in GitHub Desktop.
performSelectorWithNO (http://stackoverflow.com/q/8695810/30461)
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> | |
@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