I'd like to override the isDeleted
property in NSManagedObject
since it isn't being used in my application, and when it's accidentally been used in the past, subtle bugs were introduced. With that goal in mind, I was thinking of doing something like the following, and simply having all my NSManagedObject
types inherit from this parent. Is this an optimal approach for what I'm looking to do?
@interface CustomManagedObject : NSManagedObject
@property (nonatomic, getter=isDeleted, readonly) BOOL deleted;
@end
@implementation CustomManagedObject
- (BOOL)isDeleted
{
NSAssert(FALSE, @"Did you mean isDeleted, because that is not allowed...!");
}
// ....
@end