I'm trying to use ASIHTTPRequest. I need request be called in Asynchronous. What I'm trying to do, call this method from my Application, and be able to RETURN BOOL value, was request successed, or not. I was able to do it in Synchronous calls. How is it possible to do? I need somehow, return value to my application, was that call successed or not. My request calls, are in seperate classed, I want keep logic seperate from application. That's why I need be able return somehow value. Thanks for help!
- (BOOL)sendRequest
{
NSURL* url = [NSURL URLWithString:ServerApiURL];
__block ASIHTTPRequest* request = [ASIHTTPRequest requestWithURL:url];
[request setCompletionBlock:^
{
if ([request responseStatusCode] == 200)
{
//NEED SOMEHOW RETURN TRUE IF SUCESSED
}
}];
[request setFailedBlock:^
{
//NEED RETURN FALSE
}];
[request startAsynchronous];
}}