I have an iPhone application that needs to be updated as soon as a change is made to the server. How can I have the server “push” data to the iphone rather than the iphone constantly polling the web service?
EDIT: I want th iPhone to receive JSON updates as soon as the server processes them, without having to request.
I suppose since the server is a web service that this is called Comet, but I haven’t seen a good iPhone example yet.
That depends on how adventurous you are. There are two alternatives here:
UPDATE: Take a look at iStreamLight – Lightstreamer protocol implementation for iPhone. If it doesn’t fit your Comet web-service, you probably need to go down to the lower level, which is maintaining TCP connection using socket streams. To simplify your task in handling JSON data structures, you might want to use JSON framework for Objective-C.