mirror of
https://github.com/zhigang1992/MagicalRecord.git
synced 2026-01-12 17:32:18 +08:00
Removed some old code
This commit is contained in:
@@ -1,15 +0,0 @@
|
||||
//
|
||||
// NSManagedObject+Proxy.h
|
||||
// Progress
|
||||
//
|
||||
// Created by Brian King on 4/1/11.
|
||||
// Copyright 2011 King Software Design. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
|
||||
@interface NSManagedObject (Proxy)
|
||||
|
||||
- (id) inContext:(NSManagedObjectContext*)context;
|
||||
@end
|
||||
@@ -1,48 +0,0 @@
|
||||
//
|
||||
// NSManagedObject+Proxy.m
|
||||
// Progress
|
||||
//
|
||||
// Created by Brian King on 4/1/11.
|
||||
// Copyright 2011 King Software Design. All rights reserved.
|
||||
//
|
||||
|
||||
#import "NSManagedObject+Proxy.h"
|
||||
#import "NSManagedObject+ActiveRecord.h"
|
||||
|
||||
@interface BKThisContextManagedObject : NSObject {
|
||||
NSManagedObject *_proxyObject;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
|
||||
@implementation BKThisContextManagedObject
|
||||
|
||||
- (id) initWithManagedObject:(NSManagedObject*)theObject inContext:(NSManagedObjectContext*)context {
|
||||
if ((self = [super init])) {
|
||||
NSError *error = nil;
|
||||
_proxyObject = [[context existingObjectWithID:[theObject objectID] error:&error] retain];
|
||||
[ActiveRecordHelpers handleErrors:error];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)forwardInvocation:(NSInvocation *)invocation {
|
||||
[invocation invokeWithTarget:_proxyObject];
|
||||
[_proxyObject release];
|
||||
}
|
||||
|
||||
- (NSMethodSignature *)methodSignatureForSelector:(SEL)aSelector {
|
||||
return [_proxyObject methodSignatureForSelector:aSelector];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
|
||||
@implementation NSManagedObject (Proxy)
|
||||
|
||||
- (id) inContext:(NSManagedObjectContext*)context {
|
||||
return [[[BKThisContextManagedObject alloc] initWithManagedObject:self inContext:context] autorelease];
|
||||
}
|
||||
|
||||
@end
|
||||
Reference in New Issue
Block a user