5
'ye dönüşüyor İyi çalışan aşağıdaki kodları kullanıyorum ancak üzerinde biraz daha fazla kontrole ihtiyacım var ve özellikle de 0,9 içinde Reachability kodunu kullanmaya başlamanız gerekiyor. AFNetworking (AFJSONRequestOperation), AFHTTPClient
NSString *urlString = [NSString stringWithFormat:@"http://example.com/API/api.php"];
NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:urlString]];
AFJSONRequestOperation *operation = [AFJSONRequestOperation JSONRequestOperationWithRequest:request success:^(NSURLRequest *request, NSHTTPURLResponse *response, id JSON) {
_self.mainDictionary = [JSON valueForKeyPath:@"elements"];
[_self parseLiveData];
} failure:^(NSURLRequest *request , NSURLResponse *response , NSError *error , id JSON){
//NSLog(@"Failed: %@",[error localizedDescription]);
}];
if (operation !=nil && ([self.sharedQueue operationCount] == 0)) {
[self.sharedQueue addOperation:operation];
}
ben "setReachabilityStatusChangeBlock" yararlanmak böylece ben bir AFHTTPClient kullanmaya genelinde bu aynı kodu dönüştürebilir nasıl çalışmak mücadele ediyorum.