ObjC.create
Allocate and initialize a native object.
js
ObjC.create(className, initializer = "init", ...args)Arguments
| Argument | Type | Meaning |
|---|---|---|
className | string | Class to allocate. |
initializer | string | Init-family selector; default init. |
args | any | Initializer arguments. |
Returns
Initialized object proxy, or null for nil.
Example
js
const object = ObjC.create("NSMutableDictionary");
object.call("setObject:forKey:", "Hello", "message");
console.log(object.toJS());
object.release();Notes
Start with Objective-C step by step. Also available on app = RemoteObjC.forApp(bundleId) as app.create().