- XCode 6.3 -
XCode 6.3 , , nullable nonnull .
- (nonnull NSString *)gimmeString;
- Pre XCode 6.3 -
, clang gcc docs, , , Objective-C.
:
, , , - . , - . , could return nil - - , ,
return %something_which_evaluates_to_nil_at_compile_time%;
, , , , , - -init - -, , , .
-dequeueReusableCellWithIdentifier:forIndexPath: UITableView, , :
- (id)dequeueReusableCellWithIdentifier:(NSString *)identifier
forIndexPath:(NSIndexPath *)indexPath NS_AVAILABLE_IOS(6_0);
:
, , Objective-C, . :
@protocol MyProtocol
- (NSString *)gimmeString;
@end
, , , :
#define MD_RETURNS_NONNULL
@protocol MyProtocol
- (NSString *)gimmeString MD_RETURNS_NONNULL;
@end
, , , , , .
Swift
, - . Swift , :
protocol MyProtocol {
func gimmeString -> String
}
.
, Objective-C, , , , . , , , Swift, - , , . - , Swift .
UPD: OCLint, , - ( Clang).