XCode returns to me a warning while declaring the method below saying that "Implicit declaration of function 'completionHandler' is invalid in C99", so what is the problem?

+ (void)searchWeatherForCorrdinate:(CLLocationCoordinate2D)coordinate completionHandler:(void(^)(void))handler
{
       completionHandler();
}
有帮助吗?

解决方案

The method argument is called handler and not completionHandler, so you probably want to call

handler()

inside your method.

"completionHandler:" is part of the method signature and is called "label" of the argument , if I remember correctly.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top