iOS   发布时间:2022-05-03  发布网站:大佬教程  code.js-code.com
大佬教程收集整理的这篇文章主要介绍了ios – ‘userNotificationCenter:didReceiveNotificationResponse’实现中的冲突参数类型大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。

概述

此错误刚刚开始弹出.是bug还是更新? ConflicTing parameter types in implementation of 'userNotificationCenter:didReceiveNotificationResponse:withCompletionHandler:': 'void (^ _Nonnull __strong)(void)' vs 'void (^__str
错误刚刚开始弹出.是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;

现在警告消失了.

大佬总结

以上是大佬教程为你收集整理的ios – ‘userNotificationCenter:didReceiveNotificationResponse’实现中的冲突参数类型全部内容,希望文章能够帮你解决ios – ‘userNotificationCenter:didReceiveNotificationResponse’实现中的冲突参数类型所遇到的程序开发问题。

如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。