Created
October 22, 2014 18:41
-
-
Save LulzAugusto/18e678fe8aa7d92a2c65 to your computer and use it in GitHub Desktop.
Snippet that tells you if a core data object is new or not.
This file contains hidden or 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
// | |
// NSManagedObject+IsNew.m | |
// eduexpos | |
// | |
// Created by Luiz Augusto on 8/29/14. | |
// Copyright (c) | |
// | |
#import "NSManagedObject+IsNew.h" | |
@implementation NSManagedObject (IsNew) | |
-(BOOL) isNew { | |
NSDictionary *vals = [self committedValuesForKeys:nil]; | |
return [vals count] == 0; | |
} | |
@end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment