Clang Error on “Potential null dereference.”
问题 I keep getting Clang errors on the following type of code and I can't figure out why they're erroneous or how to resolve them to Clang's satisfaction: + (NSString *)checkForLength: (NSString *)theString error: (NSError **)error { BOOL hasLength = ([theString length] > 0); if (hasLength) return theString; else { *error = [NSError errorWithDomain:@"ErrorDomain" code:hasLength userInfo:nil]; return nil; } } Leaving aside the utterly-contrived nature of the example (which Clang did object to so