ios – ‘userNotificationCenter:didReceiveNotificationRespo
发布时间:2020-12-14 17:26:32 所属栏目:百科 来源:网络整理
导读:此错误刚刚开始弹出.是bug还是更新? Conflicting parameter types in implementation of 'userNotificationCenter:didReceiveNotificationResponse:withCompletionHandler:': 'void (^ _Nonnull __strong)(void)' vs 'void (^__strong _Nonnull)()' 我的守
此错误刚刚开始弹出.是bug还是更新?
Conflicting parameter types in implementation of 'userNotificationCenter:didReceiveNotificationResponse:withCompletionHandler:': 'void (^ _Nonnull __strong)(void)' vs 'void (^__strong _Nonnull)()' 我的守则 // Handle notification messages after display notification is tapped by the user. - (void)userNotificationCenter:(UNUserNotificationCenter *)center didReceiveNotificationResponse:(UNNotificationResponse *)response withCompletionHandler:(void (^)())completionHandler { 先前的定义(他们的代码) // The method will be called on the delegate when the user responded to the notification by opening the application,dismissing the notification or choosing a UNNotificationAction. The delegate must be set before the application returns from application:didFinishLaunchingWithOptions:. - (void)userNotificationCenter:(UNUserNotificationCenter *)center didReceiveNotificationResponse:(UNNotificationResponse *)response withCompletionHandler:(void(^)(void))completionHandler __IOS_AVAILABLE(10.0) __WATCHOS_AVAILABLE(3.0) __TVOS_PROHIBITED; 解决方法
我有同样的问题.我改成了:
- (void)userNotificationCenter:(UNUserNotificationCenter *)center didReceiveNotificationResponse:(UNNotificationResponse *)response withCompletionHandler:(void (^)(void))completionHandler; 现在警告消失了. (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |