> For the complete documentation index, see [llms.txt](https://emotiv.gitbook.io/cortex-library-for-mobile/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://emotiv.gitbook.io/cortex-library-for-mobile/objective-c-api/cortexclientdelegate-protocol.md).

# CortexClientDelegate protocol

```cpp
#import <EmotivCortexLib/CortexClient.h>
```

```objectivec
@protocol CortexClientDelegate
@required
- (void)authenticationFinished:(NSString* )authenticationCode 
                     withError:(NSError*)error;
- (void)processResponse:(NSString*)responseMessage;
@end
```

Your application must implement this protocol and use it as a delegate for the class [CortexClient](/cortex-library-for-mobile/objective-c-api/cortexclient-class.md).

### authenticationFinished

```objectivec
- (void)authenticationFinished:(NSString* )authenticationCode
                     withError:(NSError*)error;
```

The Cortex Library calls **authenticationFinished** after you called the function [authenticate](/cortex-library-for-mobile/objective-c-api/cortexclient-class.md#authenticate). If there is no error, then the parameter **authenticationCode** contains a code that you can use to call the JSON API method [loginWithAuthenticationCode](/cortex-library-for-mobile/jsonapi/loginwithauthenticationcode.md).

## processResponse

```objectivec
- (void)processResponse:(NSString*)responseMessage;
```

The argument **responseMessage** is a JSON message sent by the Cortex library.
