Skip to content

Instantly share code, notes, and snippets.

View colasbd's full-sized avatar

Colas colasbd

View GitHub Profile
@smic
smic / SMDocument.m
Created January 25, 2013 06:55
Replace the managed object context of a NSPersistentDocument by a context created by MagicalRecord.
#import "SMDocument.h"
@implementation SMDocument
- (id)init {
self = [super init];
if (self) {
NSManagedObjectContext *context = self.managedObjectContext;
if (context.concurrencyType != NSMainQueueConcurrencyType) {
NSUndoManager *undoManager = context.undoManager;
@adib
adib / BSManagedDocument.h
Created September 11, 2012 06:07
An NSDocument subclass that supports asynchronous Core Data operations
//
// BSManagedDocument.h
//
// Created by Sasmito Adibowo on 29-08-12.
// Copyright (c) 2012 Basil Salad Software. All rights reserved.
// http://basilsalad.com
//
// Licensed under the BSD License <http://www.opensource.org/licenses/bsd-license>
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES