Skip to content

Instantly share code, notes, and snippets.

@toto
Created July 8, 2010 14:40
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 toto/468090 to your computer and use it in GitHub Desktop.
Save toto/468090 to your computer and use it in GitHub Desktop.
#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