Block declaration with an empty bracket:
void (^)()
has the same semantics as a function pointer with an empty bracket:
void (*)()
This does not mean that there are no arguments. This means that no arguments are specified, so it opens the way to errors, since you can call it in the following ways:
void (^block)() = ... block(); block(10); block(@"myString");
When declaring blocks without parameters, always use:
void (^)(void)
Apple hasn't done it right everywhere, and they probably don't fix it for older APIs for compatibility reasons. You will need to keep this warning there until you move to the new API.
You can also disable this warning ( -Wstrict-prototypes ): 
or using #pragma (thanks @davidisdk ):
#pragma clang diagnostic push #pragma clang diagnostic ignored "-Wstrict-prototypes" - (void)application:(UIApplication *)application handleActionWithIdentifier:(NSString *)identifier forRemoteNotification:(NSDictionary *)userInfo withResponseInfo:(NSDictionary *)responseInfo completionHandler:(void (^)())completionHandler { } #pragma clang diagnostic pop
See LLVM discussion here or openradar bug.
Please note that there were no changes in the internal work of the API, all code will work. We will know that the API is not as good as it should be.
Sulthan Jun 10 '17 at 12:36 on 2017-06-10 12:36
source share