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
/* | |
Functions for firing a runloop while performing asynchronous tests. Add them at the top of the .m file. | |
-(void)testExample { | |
__block NSInteger count = 0; | |
dispatch_async(dispatch_get_main_queue(), ^{ | |
count = 1; | |
}); |
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
#define EMKStringableEnum(ENUM_NAME, ENUM_VALUES...) \ | |
\ | |
typedef enum { \ | |
ENUM_VALUES \ | |
} ENUM_NAME; \ | |
\ | |
\ | |
\ | |
static NSString * ENUM_NAME##ToString(int enumValue) { \ | |
static NSString *enumDescription = @"" #ENUM_VALUES; \ |
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
// | |
// proto+posing.m | |
// | |
// Created by Benedict Cohen on 04/08/2012. | |
// Copyright (c) 2012 Benedict Cohen. All rights reserved. | |
// | |
/* | |
The motivation for this code was to find a way to create subclasses which only differ slightly to their super classes | |
without having to create a new file. The solution was inspired by prototype inheritance found in Javascript (and IO). |
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
@interface NSTimer (EMKTimerBlocks) | |
+(id)EMK_scheduleTimerWithTimeInterval:(NSTimeInterval)interval repeats:(BOOL)repeats block:(void(^)(NSTimer *))block; | |
@end | |
@implementation NSTimer (EMKTimerBlocks) |
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
// | |
// main.m | |
// Protected | |
// | |
// Created by Benedict Cohen on 07/03/2012. | |
// Copyright (c) 2012 __MyCompanyName__. All rights reserved. | |
// | |
// | |
// Unlike other object orientated languages Objective-C does not | |
// provide a mechanism for scoping methods as public, protected or private. |
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
// | |
// Record.h | |
// | |
// Created by Benedict Cohen on 10/01/2012. | |
// Copyright (c) 2012 Benedict Cohen. All rights reserved. | |
// | |
// | |
/* |