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
*.pbxproj -crlf -diff -merge |
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
select * from zepisode e | |
where zqueueOrder = | |
( | |
select min(zqueueOrder) from zepisode f where e.z_pk = e.z_pk | |
) |
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
## Add this as a 'Run Script' step in your Xcode Project prior to the compile step | |
mogen=`which mogenerator` | |
if [[ -x $mogen ]]; then | |
echo "Updating data objects using $mogen" | |
cd "$PROJECT_DIR/Model" && $mogen -m MyProject.xcdatamodeld/MyProject.xcdatamodel -M ./generated -H ./entities | |
fi |
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
- (id) performSelectorWithoutWarning:(SEL)selector; | |
{ | |
#pragma clang diagnostic push | |
#pragma clang diagnostic ignored "-Warc-performSelector-leaks" | |
return [self performSelector:selector]; | |
#pragma clang diagnostic pop | |
} |
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
# Common Save Patterns | |
Create in Background | |
Save and Wait | |
Save with Block |
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) mgp_each:(void(^)(id))objectMap; | |
{ | |
[self enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) { | |
objectMap(obj); | |
}]; | |
} |
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 NSNumber (PandaHelpers) | |
- (void) mgp_times:(void(^)(NSInteger))thingToDo; | |
{ | |
NSAssert(thingToDo, @"No operation to perform"); | |
for (NSInteger i = 0; i < [self integerValue]; i++) | |
{ | |
thingToDo(i); | |
} |
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
extension String | |
{ | |
func writeTo(outputStream:NSOutputStream) | |
{ | |
if let data = self.dataUsingEncoding(NSUTF8StringEncoding, allowLossyConversion: false) | |
{ | |
let bytes = ConstUnsafePointer<UInt8>(data.bytes) | |
outputStream.write(bytes, maxLength: data.length) | |
} | |
} |
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
class CustomObject : NSManagedObject | |
{ | |
init(inContext context:NSManagedObjectContext = SingletonContextStorage.context) | |
{ | |
let klass = CustomObject.self | |
let entity = NSEntityDescription.entityForName(klass.entityName(), inManagedObjectContext: context) | |
super.init(entity: entity, insertIntoManagedObjectContext: context) | |
} | |
} |
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
#!/bin/sh | |
## $1 is the path to the model relative to the project dir | |
## $2 is the name of the model file | |
##TODO, make the path optional and the model file required | |
mogen=`which mogenerator` | |
PlistBuddy=`which PlistBuddy` | |
if [[ -x $1 ]]; then |
OlderNewer