I\'m extending the functionality of a class with a subclass, and I\'m doing some dirty stuff that make superclass methods dangerous (app will hang in a loop) in the context
You can override whichever methods you want to block in your subclass's .h
file. You can make dangerousMethod
unavailable by placing the following in your .h
file.
- (int)dangerousMethod __attribute__((unavailable("message")));
This will make the dangerousMethod
method unavailable to anyone using your subclass.
To keep other code from using the superclass's version this method, you can further restrict by putting this in your .m
file.
- (int)dangerousMethod
{
return nil;
}