Graphics Programs Reference
In-Depth Information
egate methods that handle the response would become giant if-else statements to determ-
ine what data belongs to which request.
The actor design pattern
Instead of having the
BNRFeedStore
be the delegate for every
NSURLConnection
,
we are going to create another class named
BNRConnection
. The sole purpose of an in-
stance of this class will be to manage a single
NSURLConnection
.
BNRConnection
instances will take the request prepared by the
BNRFeedStore
, start
their own
NSURLConnection
, and then receive all of the delegate messages from that
NSURLConnection
. This object will do its work without bothering the controller or the
store until it has finished. When it finishes, it will execute the completion block supplied
Figure 28.7 BNRConnection and NSURLConnection