-(NSNumber *)method:{
NSString *url = urlToPost;
NSNumber *success = [[NSNumber alloc]init];
AFHTTPRequestOperationManagerObject POST:url parameters:@{} success:^(AFHTTPRequestOperation *operation, id responseObject) {
success = [NSNumber numberWithBool:YES];
} failure:^(AFHTTPRequestOperation *operation, NSError *error) {
success = [NSNumber numberWithBool:NO];
}];
return success;
}
Everytime this method is called success is returned as null
. I have tried dispatching the block on the main queue as other similar StackOverflow answers suggest but the same problem persists.