Questions tagged [afjsonrequestoperation]

AFJSONRequestOperation is a class for downloading and working with JSON response data. It's part of AFNetworking .

AFJSONRequestOperation is a subclass of AFHTTPRequestOperation for downloading and working with JSON response data. It uses an instance of AFJSONSerialization to handle response validation and serialization.

It's part of AFNetworking :

A delightful iOS and OS X networking framework

Github: https://github.com/AFNetworking/AFContentRequestOperations/blob/master/AFJSONRequestOperation/AFJSONRequestOperation.h

27 questions
0
votes
2 answers

AFJSONRequestOperation not working (postpath works)

I am trying to post a JSON using AFNetworking. Here's the code that im using: + (RESTAPI *)sharedClient { static RESTAPI *_sharedClient = nil; static dispatch_once_t oncePredicate; dispatch_once(&oncePredicate, ^{ _sharedClient…
hdoria
  • 624
  • 2
  • 14
  • 29
0
votes
2 answers

When is my multiple AFJSONRequestOperations finished?

I am starting multiple AFJSONRequestOperation in a for loop like this: for(NSString *obj in collection) operation = [AFJSONRequestOperation JSONRequestOperationWithRequest:request success:^(NSURLRequest *request, NSHTTPURLResponse *response, id…
0
votes
1 answer

AFJSONRequestOperation, update UI if operation is successful

I use AFNetworking to send data to a remove web service, with the following block: self.operation = [AFJSONRequestOperation JSONRequestOperationWithRequest:request success:^(NSURLRequest *request, NSHTTPURLResponse *response, id JSON) { [self…
Anders
  • 2,903
  • 7
  • 58
  • 114
0
votes
1 answer

How to get HTTP response with AFJSONRequestOperation

Sending json data to server and want to get correct response.statusCode from server with AFNetworking server: // Helper method to send a HTTP response code/message function sendResponse($status = 200, $body = '', $content_type = 'text/html') { …
SpaceDust__
  • 4,844
  • 4
  • 43
  • 82
0
votes
1 answer

AFJSONRequestOperation not updating content outside of block

I am trying to use AFJSONRequestOperation to pull one peace of data from a JSON feed. The following code pulls the url just fine, and when stringURL is printed, it prints the correct url. However, I have tried a few different ways of assigning the…
Paulius Dragunas
  • 1,702
  • 3
  • 19
  • 29
0
votes
3 answers

How to parse JSON multi-array

I need to parse the JSON file provided by Google Maps API Then i use the AFNetworkingRequestHow to get the JSON response. I built this dictionary: NSDictionary *jsonDict = (NSDictionary *) JSON; NSArray *rows = [jsonDict…
Victor Casé
  • 745
  • 8
  • 15
0
votes
1 answer

AFJSONRequestOperation operation start stack

Lets say I have something like this: AFJSONRequestOperation *operation = ... [operation start]; When operation start is called, where is that operation placed ? In which queue? Is there any global (for class) operation queue where this operation…
0
votes
1 answer

iOS: AFJSONRequestOperation Encoding result in NSInvalidArgumentException - 'data parameter is nil'

I'm trying to get a JSon string but some words has "á, é, ç", etc. The JSon is: {"Error":"", "Result":{"Transacoes": [{"ClienteID":"1","ID":"915","Banco":"Bradesco","Fornecedor":"","Tipo":"Cartão de crédito - Bradesco…
0
votes
1 answer

How do I pull JSON from afnetworking to provide data for an object without it crashing

I am using afnetworking to grab JSON data from my rest api. From that JSON data I create UIViewControllers based on how many items are in the array. For example if my JSON data has 3 items, then 3 UIViewControllers are created and added as…
0
votes
1 answer

Using AFJSONRequestOperation On For Loop on iPhone SDK

I have this code that I want to eager load using AFJSONRequestOperation before continuing with the for loop but somehow it doesn't work. The code below is inside my for loop. How can I prevent my loop from proceeding even if the request is not yet…
jaytrixz
  • 4,059
  • 7
  • 38
  • 57
0
votes
1 answer

How to return a response object using AFJSONRequestOperation

I'm trying to get weather data by using AFJSONRequestOperation. The problem is I can't return the object when the query is done. Is there anyone know how to do that? My current implemation is - (NSDictionary *)getCityWeatherData:(NSString*)city { …
0
votes
1 answer

Issue accessing UIImage outside of AFImageRequestOperation ImageRequestOperationWithRequest: success block

I'm trying to display an image returned from AFImageRequestOperation ImageRequestOperationWithRequest: but it appears that the image is only available inside the success block. I've tried saving it to a class instance variable but when I NSLog it,…
1
2