I'm getting this warning in the latest Xcode 9 editor when I load up an Objective-C project that did not give this warning in Xcode 8.3.3:
-(void)userNotificationCenter:(UNUserNotificationCenter *)center didReceiveNotificationResponse:(UNNotificationResponse *)response withCompletionHandler:(void (^)())completionHandler {
...
}
WARNING: This function declaration is not a prototype
There is a fix it to insert 'void' in the place of the () in the completion handler typedef, but when you do that you get another warning:
-(void)userNotificationCenter:(UNUserNotificationCenter *)center didReceiveNotificationResponse:(UNNotificationResponse *)response withCompletionHandler:(void (^)(void))completionHandler {
...
}
WARNING: Conflicting parameter types in implementation of 'userNotificationCenter:didReceiveNotificationResponse:withCompletionHandler:': 'void (^ _Nonnull __strong)()' vs 'void (^__strong _Nonnull)(void)'
I tried commenting out this override method and let Xcode enter what it thinks is the correct entry via code completion. It gives me exactly what I had to begin with:
-(void)userNotificationCenter:(UNUserNotificationCenter *)center didReceiveNotificationResponse:(UNNotificationResponse *)response withCompletionHandler:(void (^)())completionHandler {
...
}
Which of course gives me the original warning. Is this just a bug or am I missing something here? Thanks!