ronaldoussoren / pyobjc

The Python <-> Objective-C Bridge with bindings for macOS frameworks
https://pyobjc.readthedocs.io
553 stars 47 forks source link

what's a native-selector? #598

Closed nullhook closed 6 months ago

nullhook commented 6 months ago

i'm trying to introspect methods using c++ but in objc runtime was curious what the following types are in objective-c? this is Metal.framework specific.

<native-selector libraryDataContents of <_MTLLibrary: 0x600002c7c640>
    label = <none> 
    device = <AGXG13XDevice: 0x11a840000>
        name = Apple M1 Max 
    ...>

what type is native-selector here?

ronaldoussoren commented 6 months ago

i'm trying to introspect methods using c++ but in objc runtime was curious what the following types are in objective-c? this is Metal.framework specific.

PyObjC is a Python library, not C++ ;-)

<native-selector libraryDataContents of <_MTLLibrary: 0x600002c7c640>
    label = <none> 
    device = <AGXG13XDevice: 0x11a840000>
        name = Apple M1 Max 
    ...>

what type is native-selector here?

Native-selector is the Python representation of a method in Objective-C (whose names are commonly called selectors). E.g. this is a callable object that when invoked will call a method of the _MTLLibrary object.