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
- (void)copyAttributesFromObject:(NSManagedObject *)oldObject toObject:(NSManagedObject *)newObject | |
{ | |
NSArray *attributeKeys = [[[oldObject entity] attributesByName] allKeys]; | |
NSDictionary *attributes = [oldObject dictionaryWithValuesForKeys:attributeKeys]; | |
[newObject setValuesForKeysWithDictionary:attributes]; | |
} |
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
static inline CGColorSpaceRef GetDeviceGrayScaleColorSpace(void) | |
{ | |
static CGColorSpaceRef deviceGrayscaleSpace = NULL; | |
if (deviceGrayscaleSpace == NULL) | |
deviceGrayscaleSpace = CGColorSpaceCreateDeviceGray(); | |
return deviceGrayscaleSpace; | |
} | |
static inline CGContextRef CreateGrayScaleCGBitmapContextForWidthAndHeight(void *data, | |
unsigned int width, |
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
static const CGBitmapInfo kDefault16CGBitmapInfoNoAlpha = (kCGImageAlphaNoneSkipFirst | kCGBitmapByteOrder16Host); | |
CGContextRef CreateCGBitmapContextForWidthAndHeight(void *data, unsigned int width, unsigned int height) | |
{ | |
CGColorSpaceRef colorSpace = GetDeviceRGBColorSpace(); // function to get static color space instance | |
CGBitmapInfo alphaInfo = kDefault16CGBitmapInfoNoAlpha; | |
return CGBitmapContextCreate( | |
data, | |
width, | |
height, | |
5, /* Bits per component */ |
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
@implementation ThreadyMcThreaderson | |
{ | |
dispatch_queue_t _syncQueue; | |
} | |
- (id)init | |
{ | |
self = [super init]; | |
if (self) | |
{ |