ObjCObject.respondsTo
Check selector support.
js
object.respondsTo(selector)Arguments
| Argument | Type | Meaning |
|---|---|---|
selector | string | Exact selector. |
Returns
Boolean.
Example
js
const text = ObjC.call("NSString", "stringWithString:", "Hello");
try { console.log(text.respondsTo("length")); } // true
finally { text.release(); }Notes
Start with Objective-C step by step. Here, object means a proxy returned by ObjC/RemoteObjC, not a global named ObjCObject.