In this thread on implementing a UITextInput
delegate method, the poster says that when they run static analysis on their code, they get an error on this function:
- (NSArray *)selectionRectsForRange:(UITextRange *)range
{
return nil;
}
The error is "nil returned from a method that is expected to return a non-null value."
The function declaration does not have a nullability specifier on the result. Are function results non-null by default? (I work mostly in Swift these days, and am not expert on the latest changes to Objective-C.)
They are not.
The header where that method is declared is bracketed with the "assume nonnull" macros:
So this method has in fact been marked as having a non-null return value.