initialisers do not call the designated initialiser • Communicates intent to other developers • Even more warnings if you don’t override the designated initialiser inherited from superclass (more on that later)
CBCBrewComponents *brewComponents = [[CBCBrewComponents alloc] init]; brewComponents.identifier = @"Pale Ale"; brewComponents.hopVariety = @"Fuggles"; brewComponents.maltVariety = @"Maris Otter"; brewComponents.yeastStrain = @“WLP002"; CBCBrew *brew = [brewDay brewFromComponents:brewComponents]; • No error checking code in the brewFromComponents: method to ensure that all the required components are set • Callers can initialise CBCBrewComponents using the default init inherited from NSObject
NS_UNAVAILABLE to hide inherited members not relevant to your subclass • Guard against nil inputs and communicate intent with NS_ASSUME_NONNULL_BEGIN/END