How to use nonnull and nullable Objective-C keywords in block-based API method

后端 未结 6 1368
暗喜
暗喜 2020-12-22 22:13

Consider the following method

- (void)methodWithArg:(NSString *)arg1 andArg:(NSString *)arg2 completionHandler:(void (^)(NSArray *results, NSError *error))co         


        
6条回答
  •  不知归路
    2020-12-22 22:40

    To define completions in a header file I did this

    typedef void (^PublicEventsHandler) (BOOL success, NSArray * _Nullable publicEvents);
    

    Of course, I agree with the accepted answer.

提交回复
热议问题