Originally, I have something very simple as the following. A custom category of UIAlertAction so that I can create a okay action simply by [UIAlertAction okay];
@interface UIAlertAction (Custom)
+ (UIAlertAction *)okay;
@end
@implementation UIAlertAction (Custom)
+ (UIAlertAction *)okay
{
return [UIAlertAction actionWithTitle:@"Ok"
style:UIAlertActionStyleCancel
handler:nil];
}
@end
And later on, I decide that I also want one with a complete hander so the interface become this:
@interface UIAlertAction (Custom)
+ (UIAlertAction *)okay;
+ (UIAlertAction *)okayWithHandler:(void (^ __nullable)(UIAlertAction *action))handler;
@end
And and I start getting warning message on the fist line:
Pointer is missing a nullability type specifier
I think understand the idea of nullable (honestly, the name is pretty descriptive). But what I don't understand is why adding a __nullable on the second function will make it necessary to have nullable specifier for the first one?
