You have an error defined as an argument in
+(void) agentWithGUID:(NSString *) guid completion:(void (^)(AKAgentProfile * agentProfile, NSError ** error)) completionBlock
and then again in the block, I suggest you rename one in the block, for example:
+(void) agentWithGUID:(NSString *) guid completion:(void (^)(AKAgentProfile * agentProfile, NSError ** error)) completionBlock { dispatch_queue_t requestQueue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0); dispatch_async(requestQueue, ^{ NSString * parameterizedUrl = [AKAgentProfileEndPoint stringByAppendingString:guid]; NSURL *url = [NSURL URLWithString:parameterizedUrl]; NSData *data = [NSData dataWithContentsOfURL:url]; NSError * err = nil; AKAgentProfile * agentProfile = [[[AKAgentFactory alloc] init] agentProfileWithData:data error:&error]; dispatch_async(dispatch_get_main_queue(), ^{ completionBlock(agentProfile,&err); }); }); }
source share