Objective-C API for iOS

On iOS, the Cortex library provides an API written in Objective-C. It contains only two classes:

  • CortexLib to initialize the Cortex library

  • CortexClient to send and receive JSON messages to the Cortex library

Workflow

On iOS, the basic workflow of the API is as follow:

  1. Call the static method start of the class CortexLib

  2. Alloc and init an object from the class CortexClient

  3. Call the method setDelegate of the CortexClient object

  4. Call the method sendRequest of the CortexClient object to send JSON messages to the Cortex library. You can call this methods as many times as necessary. Cortex will respond asynchronously, using the delegate you provided at step 4. Please check the Cortex API documentation to know the format of the JSON messages.

  5. Call the static method stop of the class CortexLib

Last updated