I'm a one-month veteran of iPhone development, and I have a design question regarding NSURLConnection and, well, maybe I'm missing something.
From what I can see, the way you do async network connections is by setting a delegate on the NSURLConnection. Is it me, or is this limiting? Here's what I mean...the delegate is an instance of an object that defines a set of 4 functions to handle successful, and failed, data retrieval.
This means I have to do one of two things:
* Create one class that uses if/else statements to handle responses based on the connection parameter.
* Create multiple classes, one for each HTTP call, to handle responses.
Perhaps this is a design discussion, but how are you guys handling multiple calls to a server? Do you create multiple delegates? In the Flex world, I could use one big class that has small handlers for each call by specifying different methods to call back on response.
I'm interested to know how you guys organize your class structure for handling this scenario...?
From what I can see, the way you do async network connections is by setting a delegate on the NSURLConnection. Is it me, or is this limiting? Here's what I mean...the delegate is an instance of an object that defines a set of 4 functions to handle successful, and failed, data retrieval.
This means I have to do one of two things:
* Create one class that uses if/else statements to handle responses based on the connection parameter.
* Create multiple classes, one for each HTTP call, to handle responses.
Perhaps this is a design discussion, but how are you guys handling multiple calls to a server? Do you create multiple delegates? In the Flex world, I could use one big class that has small handlers for each call by specifying different methods to call back on response.
I'm interested to know how you guys organize your class structure for handling this scenario...?