ios - Manage AFNetworking multiple requests with AFHTTPClient enqueueBatchOfHTTPRequestOperationsWithRequests method -


i want create table view slide menu fb or linkedin, mean dynamically, have make requests @ same time. using afnetworking. custom afhtttpclient called yplhttpclients , afhttpclient subclass. in class have 2 methods. sharedclient , initwithbaseurl.

i want use enqueuebatchofhttprequestoperationswithrequests method in class return data viewcontroller , create tableview of menu.

i call method uses enqueuebatchofhttprequestoperationswithrequeststhis function in client , return dictionary or information data, instead of in viewcontroller here:

 nsmutablearray *mutablerequests = [nsmutablearray array];     (nsstring *urlstring in [nsarray arraywithobjects:@"users", @"intprojects", nil]) {         [mutablerequests addobject:[[yplhttpclient sharedhttpclient] requestwithmethod:@"get" path:urlstring parameters:nil]];     }     __block nsdictionary *parsedobject1, *parsedobject2;     [[yplhttpclient sharedhttpclient] enqueuebatchofhttprequestoperationswithrequests:mutablerequests progressblock:^(nsuinteger numberofcompletedoperations, nsuinteger totalnumberofoperations) {         nslog(@"%lu of %lu completed", (unsigned long)numberofcompletedoperations, (unsigned long)totalnumberofoperations);     } completionblock:^(nsarray *operations) {         nserror *thiserror;            parsedobject1 = [nsjsonserialization jsonobjectwithdata:[[operations objectatindex:0] responsedata] options:nsjsonreadingmutablecontainers|nsjsonreadingallowfragments error:&thiserror];         nslog(@"completion: %@", parsedobject1 );         parsedobject2 = [nsjsonserialization jsonobjectwithdata:[[operations objectatindex:1] responsedata] options:nsjsonreadingmutablecontainers|nsjsonreadingallowfragments error:&thiserror];         nslog(@"completion: %@", parsedobject2 );  

i know, how can show , image while downloading data.

thank you

i'm not entirely sure you're asking, can use mbprogresshud show progress bar that's updated in progressblock (progress = numberofcompletedoperations / totalnumberofoperations).


Comments

Popular posts from this blog

SPSS keyboard combination alters encoding -

Add new record to the table by click on the button in Microsoft Access -

CSS3 Transition to highlight new elements created in JQuery -