Created
July 8, 2010 14:40
-
-
Save toto/468090 to your computer and use it in GitHub Desktop.
This file contains hidden or 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> | |
int main (int argc, const char * argv[]) { | |
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; | |
NSArray *tests = [NSArray arrayWithObjects: [NSMutableDictionary dictionary], [NSDictionary dictionary], nil]; | |
SEL sel = @selector(setObject:forKey:); | |
for(id obj in tests) { | |
BOOL result = [obj respondsToSelector:sel]; | |
NSLog(@"%@ respondsToSelector: %@ => %@", | |
NSStringFromClass([obj class]), | |
NSStringFromSelector(sel), | |
(result ? @"YES" : @"NO")); | |
} | |
[pool drain]; | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment