You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Mar 22, 2019. It is now read-only.
Activity
alexkotenko commentedon Oct 17, 2013
Hi
Please update code AFNetworking 2.0.1.
uzman commentedon Jan 17, 2014
hi,
please do below.
-download the AFNetwroking latest version.
-put the AFNetwrking dir to your project
-add the necessary framework to your project
add;
//#import "AFJSONRequestOperation.h" --> delete this
#import "AFHTTPRequestOperation.h"
here is the updated method:
(void) callMethod:(NSString ) method withCallback:( void (^)( NSError error, NSDictionary *result ) )callback
{
NSOperationQueue *callerQueue = [NSOperationQueue currentQueue];
// build the lang paramter
NSString *langString;
if (_lang && _lang.length > 0) {
langString = [NSString stringWithFormat:@"&lang=%@", _lang];
} else {
langString = @"";
}
NSString *urlString = [NSString stringWithFormat:@"%@%@%@&APPID=%@%@", _baseURL, _apiVersion, method, _apiKey, langString];
NSURL *url = [NSURL URLWithString:urlString];
NSURLRequest *request = [NSURLRequest requestWithURL:url];
/*
AFJSONRequestOperation *operation = [AFJSONRequestOperation JSONRequestOperationWithRequest:request success:^(NSURLRequest *request, NSHTTPURLResponse *response, id JSON) {
} failure:^(NSURLRequest *request, NSHTTPURLResponse *response, NSError *error, id JSON) {
}];
[_weatherQueue addOperation:operation];
*/
AFHTTPRequestOperation *operation = [[AFHTTPRequestOperation alloc] initWithRequest:request];
operation.responseSerializer = [AFJSONResponseSerializer serializer];
[operation setCompletionBlockWithSuccess:^(AFHTTPRequestOperation *operation, id responseObject) {
} failure:^(AFHTTPRequestOperation *operation, NSError *error) {
//NSLog(@"error: %@", operation.responseString);
[callerQueue addOperationWithBlock:^{
callback(error, nil);
}];
}];
[_weatherQueue addOperation:operation];
}
ijameelkhan commentedon Jun 2, 2015
I fixed it in #14