-
Notifications
You must be signed in to change notification settings - Fork 8
Sync Process #5
Description
Does it support Sync. process ? like calling a function that return a value from the service response and waiting the response to come back
-
(BOOL)checkUserExistence{
NSInteger callID;_jsonRPCService =[[DSJSONRPC alloc] initWithServiceEndpoint:[NSURL URLWithString:@"http://serv.m-diet.com/Persons.ashx"]];
DSJSONRPCCompletionHandler completionHandler = ^(NSString *methodName, NSInteger callId, id methodResult, DSJSONRPCError *methodError, NSError *internalError) {
if (methodError) {
NSLog(@"\nMethod %@(%i) returned an error: %@\n\n", methodName, callId, methodError);
return NO;
}
else if (internalError) {
NSLog(@"\nMethod %@(%i) couldn't be sent with error: %@\n\n", methodName, callId, internalError);
return NO;
}
else {
NSLog(@"\nMethod %@(%i) completed with result: %@\n\n", methodName, callId, methodResult);
NSMutableDictionary *responceDictionary = (NSMutableDictionary *)methodResult;
return [[responceDictionary objectForKey:@"result"]boolValue];
}
};callID = [_jsonRPCService callMethod:@"CheckPersonID" withParameters:@{ @"PersonID" : @"[email protected]"} onCompletion:completionHandler];
}