The code I'm working with has a utility function like
@implementation Utils
+ (BOOL)isNullOrEmpty:(nullable NSString *)string {
return (string.count > 0);
}
@end
So obviously +isNullOrEmpty:
only returns YES
if string
is non-nil, but Xcode's static analyzer doesn't know this. Is there a way to tell the analyzer that whenever this method returns true, its argument is guaranteed to be non-nil?
I thought I saw a macro that did something like this in a WWDC video a few years back, but I don't remember what it was and I haven't found anything useful googling for it.
