iOS:add NS_NOESCAPE attribute to avoid warnning

This commit is contained in:
pengfeizhou 2021-01-27 18:53:35 +08:00 committed by osborn
parent c712b1c0c0
commit f44416a139
2 changed files with 6 additions and 6 deletions

View File

@ -21,11 +21,11 @@
@interface NSObject (Doric) @interface NSObject (Doric)
- (id)apply:(id (^)(id it))block; - (id)apply:(id (NS_NOESCAPE ^)(id it))block;
- (instancetype)also:(void (^)(id it))block; - (instancetype)also:(void (NS_NOESCAPE ^)(id it))block;
- (void)let:(void (^)(id it))block; - (void)let:(void (NS_NOESCAPE ^)(id it))block;
@end @end
@interface NSArray <ObjectType> (Doric) @interface NSArray <ObjectType> (Doric)

View File

@ -20,16 +20,16 @@
#import "DoricExtensions.h" #import "DoricExtensions.h"
@implementation NSObject (Doric) @implementation NSObject (Doric)
- (id)apply:(id (^)(id it))block { - (id)apply:(id (^)(NS_NOESCAPE id it))block {
return block(self); return block(self);
} }
- (instancetype)also:(void (^)(id it))block { - (instancetype)also:(void (NS_NOESCAPE ^)(id it))block {
block(self); block(self);
return self; return self;
} }
- (void)let:(void (^)(id it))block { - (void)let:(void (NS_NOESCAPE ^)(id it))block {
block(self); block(self);
} }
@end @end