Skip to content

Instantly share code, notes, and snippets.

View joericioppo's full-sized avatar

Joe Ricioppo joericioppo

View GitHub Profile
@joericioppo
joericioppo / gist:1805302
Created February 12, 2012 00:28
An Objective-C PSD writer that got shelved. Nick Paulson and Gus Mueller helped me out with this.
#import <Foundation/Foundation.h>
@interface FOOPSDWriter : NSObject {
NSMutableData *data_;
NSUInteger location_;
}
- (void) writeInt64:(UInt64)value;
- (void) writeInt32:(UInt32)value;
@implementation NSArray (NSArray+MyAdditions)
- (NSArray *)arrayOfClass:(Class)class {
// oh look, dictionaries..
}
@implementation NSObject (NSObject+MyAdditions)
- (void)reloadLineIndexes {
NSString *diffString = [[self textStorage] string];
if (diffString.length < 1) {
self.highestNewFileLineNumber = 0;
self.lineIndexes = nil;
return;
}