Skip to content

Instantly share code, notes, and snippets.

@LulzAugusto
Created October 22, 2014 18:41
Show Gist options
  • Save LulzAugusto/18e678fe8aa7d92a2c65 to your computer and use it in GitHub Desktop.
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.
//
// 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