Override of a method Apple documents as requiring a super call omits it
ID |
objectivec.correctness.missing_super_call |
Severity |
low |
Remediation Complexity |
trivial |
Remediation Risk |
low |
Remediation Effort |
low |
Resource |
Api Misuse |
Language |
Objective-C |
Description
This override never calls the superclass implementation, and its documentation requires one. UIKit does real work in these methods - laying out subviews, wiring up appearance callbacks, resetting a reused cell, running XCTest’s own setup and teardown - and skipping it leaves the object in a half-configured state, usually as a layout or lifecycle bug far from this code. Add the [super …] call: first for the appearance and load callbacks, last for updateConstraints and tearDown. dealloc is deliberately outside this list; it is covered by dealloc-missing-super.
Rationale
This override never calls the superclass implementation, and its documentation requires one. UIKit does real work in these methods - laying out subviews, wiring up appearance callbacks, resetting a reused cell, running XCTest’s own setup and teardown - and skipping it leaves the object in a half-configured state, usually as a layout or lifecycle bug far from this code. Add the [super …] call: first for the appearance and load callbacks, last for updateConstraints and tearDown. dealloc is deliberately outside this list; it is covered by dealloc-missing-super.
The following code illustrates the pattern detected by this rule:
@implementation FeedView
// FLAGGED: Override of a method Apple documents as requiring a super call omits it
- (void)layoutSubviews {
[self repositionHeader];
}
@end