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 SomeObject : NSObject | |
+ (void)classMethod; | |
@end | |
@implementation SomeObject |
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
- (void)loadView { | |
if (!self.nibName) { | |
NSString * nibName = nil; | |
NSString * className = NSStringFromClass([self class]); | |
if ([className hasSuffix:@"Controller"]) | |
nibName = [className substringToIndex:[className rangeOfString:@"Controller" options:NSBackwardsSearch].location]; | |
if (!nibName || ![self.nibBundle pathForResource:nibName ofType:@"nib"]) | |
nibName = className; | |
if ([self.nibBundle pathForResource:nibName ofType:@"nib"]) { | |
[self.nibBundle loadNibNamed:nibName owner:self options:nil]; |
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 SingletonClass : NSObject | |
+ (SingletonClass *) sharedInstance; | |
@end |
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
/* Dave's DDFileReader from http://stackoverflow.com/questions/3707427/how-to-read-data-from-nsfilehandle-line-by-line */ | |
//DDFileReader.h | |
@interface DDFileReader : NSObject { | |
NSString * filePath; | |
NSFileHandle * fileHandle; | |
unsigned long long currentOffset; | |
unsigned long long totalFileLength; |
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
- (void) parseData:(NSData *)data { | |
[savedData appendData:data]; | |
NSUInteger index = 0; | |
NSUInteger length = [savedData length]; | |
uint8_t * bytes = (uint8_t *) [savedData bytes]; | |
NSUInteger packetIndex; | |
NewerOlder