I am creating an iOS app that consumes web services.
I have a class that makes the connections and stores the response in a variable. It also has a status variable where 1 indicates successful connection.
I have set up an NStimer and a function to check when the connection and download is done and if it was successful.
My question is:
Is this a proper way to manage the connection and its outcome?
any suggestions?
Here is the programming guide from Apple Developer website and it describes how to use NSURLConnection delegate. You can manage the received data in
connectionDidFinishLoading:method. Notice that using these delegate methods will load data asynchronously. If you want to handle data synchronously, please trysendSynchronousRequest:returningResponse:error:, but this function should never be call in the main thread.