MCPcopy Create free account
hub / github.com/SSheldon/rust-objc / register

Method register

src/runtime.rs:148–153  ·  view source on GitHub ↗

Registers a method with the Objective-C runtime system, maps the method name to a selector, and returns the selector value.

(name: &str)

Source from the content-addressed store, hash-verified

146 /// Registers a method with the Objective-C runtime system,
147 /// maps the method name to a selector, and returns the selector value.
148 pub fn register(name: &str) -> Sel {
149 let name = CString::new(name).unwrap();
150 unsafe {
151 sel_registerName(name.as_ptr())
152 }
153 }
154
155 /// Returns the name of the method specified by self.
156 pub fn name(&self) -> &str {

Callers 4

custom_classFunction · 0.45
custom_protocolFunction · 0.45
custom_subprotocolFunction · 0.45
custom_subclassFunction · 0.45

Calls 1

as_ptrMethod · 0.80

Tested by 4

custom_classFunction · 0.36
custom_protocolFunction · 0.36
custom_subprotocolFunction · 0.36
custom_subclassFunction · 0.36