diff --git a/crates/objc2/src/declare/ivar.rs b/crates/objc2/src/declare/ivar.rs index 0a229edb7..05d2acfcd 100644 --- a/crates/objc2/src/declare/ivar.rs +++ b/crates/objc2/src/declare/ivar.rs @@ -94,6 +94,7 @@ pub unsafe trait IvarType { #[doc(hidden)] unsafe fn __offset(ptr: NonNull) -> isize { let obj = unsafe { ptr.as_ref() }; + std::println!("get offset: {ptr:?}"); ivar_offset(obj.class(), Self::NAME, &Self::Type::ENCODING) } } diff --git a/crates/objc2/src/runtime/mod.rs b/crates/objc2/src/runtime/mod.rs index 0ad0df73b..a7fa855b4 100644 --- a/crates/objc2/src/runtime/mod.rs +++ b/crates/objc2/src/runtime/mod.rs @@ -1002,6 +1002,7 @@ impl fmt::Display for AnyProtocol { } pub(crate) fn ivar_offset(cls: &AnyClass, name: &str, expected: &Encoding) -> isize { + std::println!("get offset of cls: {cls:?}"); match cls.instance_variable(name) { Some(ivar) => { let encoding = ivar.type_encoding();