Files
RestKit/Code/CoreData/NSManagedObject+RKAdditions.m
Blake Watters 8dc54a89b2 Major overhaul to the Core Data managed object identification and relationship connection support.
* Replaces primary key with `RKEntityIdentifier`
* Add support for use of compound keys for object identification
* Refactor `RKConnectionMapping` to `RKConnectionDescription` and add support for connecting with multiple attributes
* Clarify naming of representation key methods to better match naming conventions
* Add type transformation support for object identification
* Greatly expand test coverage for object identification
* Drop the `NSEntityDescription` category
* Simplify the `RKManagedObjectCaching` protocol
* Add compound key support to the Fetch Request and In Memory Cache implementations
* Replace Kiwi with Specta for tests where contexts are helpful for organization
* Rename `defaultValueForMissingAttribute` to `defaultValueForAttribute`
2012-11-27 10:29:36 -05:00

29 lines
654 B
Objective-C

//
// NSManagedObject+RKAdditions.m
// RestKit
//
// Created by Blake Watters on 3/14/12.
// Copyright (c) 2009-2012 RestKit. All rights reserved.
//
#import "NSManagedObject+RKAdditions.h"
#import "NSManagedObjectContext+RKAdditions.h"
#import "RKLog.h"
#import "RKManagedObjectStore.h"
@implementation NSManagedObject (RKAdditions)
- (BOOL)hasBeenDeleted
{
NSManagedObject *managedObjectClone = [[self managedObjectContext] existingObjectWithID:[self objectID] error:nil];
return (managedObjectClone == nil) ? YES : NO;
}
- (BOOL)isNew
{
NSDictionary *vals = [self committedValuesForKeys:nil];
return [vals count] == 0;
}
@end