# ObjCObject.set

Set a value through native key-value coding.

```js
object.set(key, value)
```

## Arguments

| Argument | Type | Meaning |
| --- | --- | --- |
| `key` | string | Nonempty KVC key. |
| `value` | any | Supported native argument. |

## Returns

This proxy.

## Example

```js
const dictionary = ObjC.create("NSMutableDictionary");
try {
  dictionary.set("message", "Hello");
  console.log(dictionary.toJS());
} finally { dictionary.release(); }
```

## Notes

Start with [Objective-C step by step](/doc/objc). Here, object means a proxy returned by ObjC/RemoteObjC, not a global named ObjCObject.

[All JavaScript APIs](https://mcp.applesauceos.com/doc/api.md) · [Automation playbook](https://mcp.applesauceos.com/doc/ai.md)
