Answer the question
In order to leave comments, you need to log in
Is it possible to create a single NSURLConnection call method for the entire application?
Good day!
Essence of the question: the IOS application has several different ViewControllers, let's say 5, each is processed by its own class, and in 3 of them the same structure of requesting data from the server is processed:
NSURLConnection *conn = [[NSURLConnection alloc] initWithRequest:request delegate:self];
and further processing of the response in methods: - (void)connection:...
Answer the question
In order to leave comments, you need to log in
Usually, a singleton (or something similar to a singleton with the possibility of emergency re-creation) is created to communicate with the server. In which requests and yurls are encapsulated. The methods take blocks in the parameter to process the response of the server or delegate.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question