Question

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();
}
Était-ce utile?

La solution

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.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top