There's no way to do this via code.
There's a compiler warning (controlled via Xcode's build setting "Implicit Synthesized Properties", CLANG_WARN_OBJC_MISSING_PROPERTY_SYNTHESIS
) but you have to manually set this on the implementation file, so for your case that's not really helpful.
Here's another idea: Change your implementation to add the properties using a category on PAPreferences
instead of a subclass. Then the compiler can't synthesize the accessors and will emit a warning if the @dynamic
is missing.
@interface PAPreferences (SynthesizedProperties)
@property int foo;
@end
@implementation PAPreferences (SynthesizedProperties)
@end
Result:
> warning: property 'foo' requires method 'foo' to be defined - use @dynamic or provide a method implementation in this category
Additionally (or instead) you can introspect the property during runtime to detect accidentally synthesized accessors and emit a warning in this case.