У меня проблема с обработчиком завершения.
У меня есть метод, как показано ниже
-(void)authenticationRealmWithCompletion:(void (^)(AuthenticationRealm *authenticationRealm, NSError *error))completion realmId:(NSString *)realmId postDictionary:(NSDictionary *)postDictionary{
//my code
}
Теперь я объявил переменную, как показано ниже
typedef void(^completionHandler)(AuthenticationRealm *authenticationRealm, NSError *error);
Теперь я хочу назначить, как показано ниже
-(void)authenticationRealmWithCompletion:(void (^)(AuthenticationRealm *authenticationRealm, NSError *error))completion realmId:(NSString *)realmId postDictionary:(NSDictionary *)postDictionary{
[completion copy];
//**HERE**..... Error Line
completionHandler(completion);
//my code
}
Но я получаю ошибку как Redefinition of 'completion'
Пожалуйста, предложите, как назначить обработчик завершения другому.