I guess this is solved by writing a @protocol.
But I'm hungry for knowledge. Is there some flag or other way to require subclasses to override specific methods and not call super? Like the opposite of NS_REQUIRES_SUPER / objc_requires_super?
I do that in code not using any flags.
- I add assertion in the method of the super class that needs to be overridden in case this method is get called
Here I have a class that have a method fetchUserData
that should be overridden by the child class
- (void)fetchUserData
{
NSString *descrip = [NSString stringWithFormat:@"child implementation for method:%@ : %@",NSStringFromSelector(_cmd), NSStringFromClass([self class])
NSAssert(NO, descrip);
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With