문제

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