This Sample works for me.
dispatch_queue_t queue = dispatch_queue_create("_downloadQueue", NULL);
dispatch_async(queue, ^(void){
NSString *_apiURL = @"http://yours.com";
__weak ASIFormDataRequest *formRequest = [ASIFormDataRequest requestWithURL:[NSURL URLWithString:_apiURL]];
[formRequest setCompletionBlock:^{
NSLog(@"response string : %@", [formRequest responseString]);
dispatch_async(dispatch_get_main_queue(), ^(void) {
//To execute the UIs.
});
}];
[formRequest setFailedBlock:^{
dispatch_async(dispatch_get_main_queue(), ^(void) {
//To execute the UIs.
});
}];
[formRequest startAsynchronous];
});
And in your code, may you need to change the execute process about " [requestFormBase1 startAsynchronous]; " to be last running, like this :
NSString *stringURL = @"http://myserv.com";
NSURL *urlPosting = [NSURL URLWithString:stringURL];
__weak ASIFormDataRequest *requestFormBase1 = [ASIFormDataRequest requestWithURL:urlPosting];
[requestFormBase1 addPostValue:valueToPost forKey:@"key"];
[requestFormBase1 setCompletionBlock:^{ ... }];
[requestFormBase1 startAsynchronous];
This's the Block method running process standard. Hope it will help you.