Returns the class definition of a specified class, or `None` if the class is not registered with the Objective-C runtime.
(name: &str)
| 276 | /// Returns the class definition of a specified class, or `None` if the |
| 277 | /// class is not registered with the Objective-C runtime. |
| 278 | pub fn get(name: &str) -> Option<&'static Class> { |
| 279 | let name = CString::new(name).unwrap(); |
| 280 | unsafe { |
| 281 | let cls = objc_getClass(name.as_ptr()); |
| 282 | if cls.is_null() { None } else { Some(&*cls) } |
| 283 | } |
| 284 | } |
| 285 | |
| 286 | /// Obtains the list of registered class definitions. |
| 287 | pub fn classes() -> MallocBuffer<&'static Class> { |