سؤال

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