Viewing the CallbackHandler File

In Xcode, view and understand the CallBackHandler file.

CallbackHandler is a subclass of SUPDefaultCallbackHandler, and is used to listen for events sent from the server. It also implements the SUPApplicationCallback protocol to get connection, registration, and device state change notifications. The header, CallbackHandler.h, is referenced in a number of classes in this application, so you would create it first. You can create new Objective-C class files from the main menu: File > New > New File.

There are two threads involved in the SUP101 application — the main thread, which is driven by the client application user interface controller, and the mobile object client access thread, which handles data synchronization with the server. In iOS, all code that updates the user interface must be called on the main thread, so it is a good idea to send notifications that might trigger changes to the interface from the main thread.

  1. Click the CallbackHandler.h file to view the provided source code.
  2. Click the CallbackHandler.m file to view the provided source code.