- (void)application:(UIApplication *)application handleActionWithIdentifier:(NSString *)identifier forRemoteNotification:(NSDictionary *)userInfo completionHandler:(void (^)(void))completionHandler {}
我收到此警告。有人可以告诉我这里出什么问题吗?
'application:handleActionWithIdentifier:forRemoteNotification:completionHandler:'的实现中参数类型冲突:'void(^ _Nonnull __strong)()'vs'void(^ __ strong _Nonnull)(void)'
答案 0 :(得分:3)
一种解决方法是像这样禁用Clang的-Wstrict原型:
- (void)application:(UIApplication *)application handleActionWithIdentifier:(NSString *)identifier forRemoteNotification:(NSDictionary *)userInfo
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wstrict-prototypes"
completionHandler:(void(^)())completionHandler
#pragma clang diagnostic pop
{}
handleActionWithIdentifier:forLocalNotifications也是如此。 这似乎是一个错误。