Domanda

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();
}
È stato utile?

Soluzione

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.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top