Graphics Programs Reference
In-Depth Information
and our junior-level people write the controllers and user interface aspects of an applica-
tion. Smart junior-level people pick up on how the store works and end up becoming
senior-level people themselves.
Stores also give the application a unified point of contact with an external source. In addi-
tion to things like caching and storing user credentials for web servers that we've already
seen or mentioned, there is another bonus: it is easy to test what happens when an applica-
tion is “offline.” Applications that do a lot of their work with a server aren't guaranteed to
have Internet access. An application of this type still needs to work - at least somewhat -
while offline.
Normally, it is difficult to test what an application will do when it is offline. However,
with store objects and their
BNRConnection
friends, it becomes totally simple. You
write debug code in
BNRConnection
's
start
method. When debugging, this method
will send the
BNRConnection
the message
connection:didFailWithError:
instead of starting up the connection. This simulates what would occur if the connection
actually failed without having to turn off your device or the simulator's Internet connec-
tion over and over again.