Skip to content

Instantly share code, notes, and snippets.

@imhuntingwabbits
imhuntingwabbits / AbstractTestCase.m
Created July 1, 2016 19:04
Abstract XCTestCase Subclass
@interface AbstractTestCase: XCTestCase
@end
@implementation
- (void)performTest:(XCTestRun *)run {
if (NO == ([self class] == [AbstractTestCase class])) {
[super performTest:run];
}
}
import Cocoa
import CoreData
var model = NSManagedObjectModel()
var personEntity = NSEntityDescription()
personEntity.name = "Person"
var name = NSAttributeDescription()
name.attributeType = NSAttributeType.StringAttributeType
@imhuntingwabbits
imhuntingwabbits / CoreData.m
Last active August 29, 2015 13:56
CodeRunner Templates
#import <Foundation/Foundation.h>
#import <CoreData/CoreData.h>
int main(int argc, char *argv[]) {
@autoreleasepool {
NSURL *u = [NSURL fileURLWithPath:@"/Users/nick/Source/Builds/Debug-iphonesimulator/Demo.app/Demo.momd"];
NSManagedObjectModel *m = [[NSManagedObjectModel alloc] initWithContentsOfURL:u];
NSPersistentStoreCoordinator *psc = [[NSPersistentStoreCoordinator alloc] initWithManagedObjectModel:m];
[m release]; m = nil;