I am learning ReactiveObjC , the ReactiveCocoa Objective-C version.
For the code following: In RACSignal.h
,
- (RACSignal *)reduceEach:(id _Nullable (^)())reduceBlock RAC_WARN_UNUSED_RESULT;
(id _Nullable (^)())
Xcode reports a error:
This block declaration is not a prototype
Multiple parameters could be put in the reduceBlock()
.
As the code following: In UIAlertView+RACSignalSupport.m
, and others ,
- (RACSignal *)rac_buttonClickedSignal {
RACSignal *signal = [[[[self.rac_delegateProxy
signalForSelector:@selector(alertView:clickedButtonAtIndex:)]
reduceEach:^(UIAlertView *alertView, NSNumber *buttonIndex){
return buttonIndex;
}]
......
return signal;
}
Kinda generic. I think I can put zero or more parameters in the block, with void (^block)()
declared.
The syntax is not supported now in Xcode. I want to know how to solve it, and why.
Many Thanks in advance.
You can get the "not a prototype" warning when you try to define a function or block prototype using an empty set of parentheses ()
.
Put a void
in the middle of the parens—i.e. (id _Nullable (^)(void))
, and you should fix the problem.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With