Last active
December 31, 2015 07:09
-
-
Save eito/7952128 to your computer and use it in GitHub Desktop.
NSURLSession category bug
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> | |
@interface NSURLSession (Stuff) | |
-(void)doStuff; | |
@end | |
@implementation NSURLSession (Stuff) | |
-(void)doStuff { | |
NSLog(@"stuff"); | |
} | |
@end | |
int main(int argc, char *argv[]) { | |
@autoreleasepool { | |
NSURLSessionConfiguration *config = [NSURLSessionConfiguration defaultSessionConfiguration]; | |
NSURLSession *session = [NSURLSession sessionWithConfiguration:config delegate:nil delegateQueue:nil]; | |
if ([session isKindOfClass:[NSURLSession class]]) { | |
NSLog(@"YES"); | |
} | |
else { | |
NSLog(@"NO"); | |
} | |
[session doStuff]; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment