Let’s assume that I have a method in class like this:
- (void)doSomethingOnlyWhenNeeded {
#ifdef NEEDED
DO SOMETHING
#endif
}
If I define NEEDED, everything is OK. But if NEEDED is not defined than method is empty and I want it to be removed. Is there any optimization that removes calls to such empty methods? If not, why that can be a bad idea? If yes, then do I have any control over that?
Where to find documentation on this feature?
They are not removed during compilation, this can be a way to override a super class method, and it will stop that method being called regardless of the contents of the child classes method, this is how I am assuming the method persists with no content.