Created
February 10, 2016 07:04
-
-
Save nolili/355ed163aa5dac77dfe9 to your computer and use it in GitHub Desktop.
NSStream Debugging (Helper)
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 NSStream (Helper) | |
+ (NSString *)descriptionFromEvent:(NSStreamEvent)event; | |
@end | |
#import "NSStream+Helper.h" | |
@implementation NSStream(Helper) | |
+ (NSString *)descriptionFromEvent:(NSStreamEvent)event; | |
{ | |
switch (event) { | |
case NSStreamEventNone: | |
return @"NSStreamEventNone"; | |
case NSStreamEventOpenCompleted: | |
return @"NSStreamEventOpenCompleted"; | |
case NSStreamEventHasBytesAvailable: | |
return @"NSStreamEventHasBytesAvailable"; | |
case NSStreamEventHasSpaceAvailable: | |
return @"NSStreamEventHasSpaceAvailable"; | |
case NSStreamEventErrorOccurred: | |
return @"NSStreamEventErrorOccurred"; | |
case NSStreamEventEndEncountered: | |
return @"NSStreamEventEndEncountered"; | |
} | |
return nil; | |
} | |
@end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment