We are making a big change to our Core Data model. There are a couple of attributes that we don't want to use anymore. For example, the following values
for SomeObject
.
However, we don't want to simply remove values
from our Core Data yet because we are using it everywhere in our project.
I am wondering whether it is possible to add a deprecation
tag to some of the attributes in Core Data, so that we will get some warning whenever we use them.
@interface SomeObject : _SomeObject
// ...
@end
@interface _SomeObject : NSManagedObject {}
@property (nonatomic, strong) NSNumber* values;
// and a massive amount of auto-generated code by core data
@end
And then I saw this post about how to flag a method as deprecated in objective C. And I tried adding the deprecation tag inside the _SomeObject.h
such as:
@interface _SomeObject : NSManagedObject {}
@property (nonatomic, strong) NSNumber* values __attribute__((deprecated));
// and a massive amount of auto-generated code by core data
@end
And it works exactly the way as we want where we have 'values' is deprecated
warnings all over the place. So we will be able to focus on all these warnings and fix all of them before our next ship. But one thing that I don't feel quite comfortable about is that we are modifying the auto generated code by Core Data.
So finally, my question is:
Is it possible to add deprecation to methods without touching the _SomeObject.h
file?