---
product: Chilkat
product_version: 11.7.0
language: objc
language_label: Objective-C
document: language guide
---
> Chilkat 11.7.0 · language=objc · this file: `https://www.chilkatsoft.com/ai-docs/v/11.7.0/objc/guide.md`
> Class pages: `https://www.chilkatsoft.com/ai-docs/v/11.7.0/objc/classes/<Class>.md`

# Chilkat for Objective-C — language guide — v11.7.0

## 1. Which Chilkat binding this is

This is the **Chilkat Objective-C library** for macOS and iOS: classes `CkoHttp`, `CkoZip`, `CkoBinData`, …, created with `[[CkoHttp alloc] init]`; methods `[http QuickGetStr: url]`; properties as Objective-C properties (`http.Port`, `http.LastErrorText`). Static libraries (universal on macOS; iOS device and simulator).

## 2. Install and requirements

Download the library from [https://www.chilkatsoft.com/downloads_objc.asp](https://www.chilkatsoft.com/downloads_objc.asp) (macOS) or [https://www.chilkatsoft.com/downloads_ios.asp](https://www.chilkatsoft.com/downloads_ios.asp) (iOS), add the static library and headers to the Xcode project, and `#import` the needed `CkoXxx.h` headers.

## 3. Unlocking and object creation

```objc
#import <CkoGlobal.h>
#import <CkoHttp.h>

// Required once per process, before any other Chilkat object. Any string unlocks a 30-day trial.
CkoGlobal *glob = [[CkoGlobal alloc] init];
BOOL success = [glob UnlockBundle: @"Anything for 30-day trial"];
if (success != YES) {
    NSLog(@"%@", glob.LastErrorText);
    return;
}

CkoHttp *http = [[CkoHttp alloc] init];
```

- Unlocking only sets a flag in memory: no license files, no network call, so the call is repeated each time the program runs. Extra calls are harmless no-ops; the `Global` object can be discarded afterwards.
- If a program forgets to unlock, Chilkat runs in trial mode and stops working when the trial expires — always include the call, and use the purchased unlock code in production.
- `UnlockBundle` unlocks every class; per-class `UnlockComponent` methods exist only in old code.

## 4. Error model

Chilkat methods **do not throw**. The note under each method on the class page says how it reports failure: a `BOOL` status method returns `NO`; a string-returning method returns `nil` (an `NSString *`); an object-returning method returns `nil`; for a numeric result check `LastMethodSuccess`. `LastErrorText` holds the diagnostic in every case.

Literals in Objective-C: true is `YES`, false is `NO`, null/none is `nil`.

## 5. Strings, bytes and encodings

- Strings are `NSString *`; a `charset` argument names the encoding of the *bytes* being produced or read.
- Binary data is `NSData *` in and out; larger or reusable data goes through `CkoBinData` (`…Bd` methods) and text through `CkoStringBuilder` (`…Sb` methods).
- Methods with `2`/`3` suffixes or `Quick…` prefixes are distinct members, not overloads.

## 6. Object lifetime and threading

Objects are released by ARC (or `release` under manual reference counting).

A Chilkat object may be used from any thread, but **one object must not be used by two threads at the same time**: create one object per thread or protect it with a lock. Objects are independent — there is no shared global state other than the unlock flag and the few `Global` settings.

## 7. Progress callbacks and async

Progress events are supported: see the "Events and callbacks" section of a class page for the event list and how to attach a handler in this binding (AbortCheck, PercentDone, ProgressInfo and TaskCompleted are the standard ones). Every method with an "Async variant" line also has an `XAsync` twin that returns a `Task` immediately; poll `Finished` or use the `TaskCompleted` event, then read the result from the task. No new Async methods are added from 11.7.0 on. In Objective-C, implement the class's progress protocol (e.g. `CkoHttpProgress`) and set the delegate on `EventCallbackObject`; see the "Events and callbacks" section of a class page.

## 8. Common mistakes an AI makes with this binding

1. Using `CkHttp` (C++) spelling — the Apple classes are `CkoHttp`.
2. Forgetting the colon-style method call (`[http QuickGetStr: url]`).
3. Omitting `Global.UnlockBundle` (the program runs in trial mode and stops working after 30 days).
4. Inventing members by analogy with other libraries. If a member is not on the class page, it does not exist — look it up rather than guessing.
5. Using deprecated members that older examples still show. The class page lists each one with its replacement; `deprecated.md` lists them all.
6. Ignoring the failure path. Every Chilkat method reports failure (see each method's note); `LastErrorText` says why, and printing it is the first debugging step.
7. Using one Chilkat object from two threads at the same time. Create one object per thread, or protect it with a lock.

## 9. Instructions block for coding agents

Paste into `CLAUDE.md`, `.cursor/rules`, or Copilot instructions:

```
This project uses Chilkat 11.7.0 from Objective-C (the Chilkat Objective-C library; classes CkoHttp etc.).
- Reference: https://www.chilkatsoft.com/ai-docs/v/11.7.0/objc/ — read guide.md once, then classes/<Class>.md for each class used.
- Call [[[CkoGlobal alloc] init] UnlockBundle: ...] once at startup.
- Chilkat methods never throw: check the NO/nil result and NSLog obj.LastErrorText.
- Never use a member that is not on the class page; never use members listed as deprecated.
```

## 10. Classes

[Class index for Objective-C](https://www.chilkatsoft.com/ai-docs/v/11.7.0/objc/index.md)
