gpt4 book ai didi

ios - 'userNotificationCenter :didReceiveNotificationResponse 实现中的参数类型冲突

转载 作者:可可西里 更新时间:2023-11-01 05:39:53 25 4
gpt4 key购买 nike

这个错误刚刚开始弹出。是错误还是更新?

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 实现中的参数类型冲突,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48250511/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com