My app requires an open connection with a server for real-time updates. I need to be able to navigate through a number of views, during which I can send and receive data asynchronously. The goal is to have the app automatically update data in real time.
What I'd like to do is have a separate socket manager class inheriting from NSObject that has the delegate functions of CocoaAsyncSocket plus some helper functions, and then when stuff happens with the persistent socket, that is handled within the class and it sends out notifications that have different effects depending on which view you are currently on.
What is the preferred way of doing this? Set up a protocol for this socket manager and have every UI view be a delegate*? Or would I be better off having the socket manager sit in a background thread and send notifications? Is there a preferred choice vis a vis battery life?
*More or less like http://www.raywenderlich.com/3932/how-to-create-a-socket-based-iphone-app-and-server