Macro fruity__bbqsrc::objc_class [−][src]
macro_rules! objc_class { ($name:ident) => { ... }; ($name:expr) => { ... }; }
Expand description
Returns a Class
reference with the given name.
The symbol of the class is referenced by adding a OBJC_CLASS_$_
prefix to
$name
.
This will not demangle This does not currently support mangled symbol names.
Feature Flag
This macro is defined in objc
, which requires the
objc
feature flag.
Examples
The class name can be passed as an identifier or string literal:
use fruity::objc::Class; let class_a: &Class = fruity::objc_class!(NSObject); let class_b: &Class = fruity::objc_class!("NSObject"); assert_eq!(class_a, class_b);
If the symbol cannot be be found at link time, an error will occur:
ⓘ
let class: &Class = fruity::objc_class!(NSFruity);