diff --git a/src/input/appkit.rs b/src/input/appkit.rs index 4c8495c9..f2073d55 100644 --- a/src/input/appkit.rs +++ b/src/input/appkit.rs @@ -8,25 +8,25 @@ use crate::utils::load; /// Called when editing this text field has ended (e.g. user pressed enter). extern "C" fn text_did_end_editing(this: &mut Object, _: Sel, _info: id) { let view = load::(this, TEXTFIELD_DELEGATE_PTR); - let s = NSString::retain(unsafe { msg_send![this, stringValue] }); + let s = NSString::retain(unsafe { msg_send![&*this, stringValue] }); view.text_did_end_editing(s.to_str()); } extern "C" fn text_did_begin_editing(this: &mut Object, _: Sel, _info: id) { let view = load::(this, TEXTFIELD_DELEGATE_PTR); - let s = NSString::retain(unsafe { msg_send![this, stringValue] }); + let s = NSString::retain(unsafe { msg_send![&*this, stringValue] }); view.text_did_begin_editing(s.to_str()); } extern "C" fn text_did_change(this: &mut Object, _: Sel, _info: id) { let view = load::(this, TEXTFIELD_DELEGATE_PTR); - let s = NSString::retain(unsafe { msg_send![this, stringValue] }); + let s = NSString::retain(unsafe { msg_send![&*this, stringValue] }); view.text_did_change(s.to_str()); } extern "C" fn text_should_begin_editing(this: &mut Object, _: Sel, _info: id) -> BOOL { let view = load::(this, TEXTFIELD_DELEGATE_PTR); - let s = NSString::retain(unsafe { msg_send![this, stringValue] }); + let s = NSString::retain(unsafe { msg_send![&*this, stringValue] }); match view.text_should_begin_editing(s.to_str()) { true => YES, @@ -36,7 +36,7 @@ extern "C" fn text_should_begin_editing(this: &mut Object, extern "C" fn text_should_end_editing(this: &mut Object, _: Sel, _info: id) -> BOOL { let view = load::(this, TEXTFIELD_DELEGATE_PTR); - let s = NSString::retain(unsafe { msg_send![this, stringValue] }); + let s = NSString::retain(unsafe { msg_send![&*this, stringValue] }); match view.text_should_end_editing(s.to_str()) { true => YES, false => NO diff --git a/src/view/controller/appkit.rs b/src/view/controller/appkit.rs index 45fb03a4..9aec40c7 100644 --- a/src/view/controller/appkit.rs +++ b/src/view/controller/appkit.rs @@ -13,7 +13,7 @@ use crate::view::{ViewDelegate, VIEW_DELEGATE_PTR}; /// Called when the view controller receives a `viewWillAppear` message. extern "C" fn will_appear(this: &mut Object, _: Sel) { unsafe { - let _: () = msg_send![super(this, class!(NSViewController)), viewWillAppear]; + let _: () = msg_send![super(&mut *this, class!(NSViewController)), viewWillAppear]; } let controller = load::(this, VIEW_DELEGATE_PTR); @@ -23,7 +23,7 @@ extern "C" fn will_appear(this: &mut Object, _: Sel) { /// Called when the view controller receives a `viewDidAppear` message. extern "C" fn did_appear(this: &mut Object, _: Sel) { unsafe { - let _: () = msg_send![super(this, class!(NSViewController)), viewDidAppear]; + let _: () = msg_send![super(&mut *this, class!(NSViewController)), viewDidAppear]; } let controller = load::(this, VIEW_DELEGATE_PTR); @@ -33,7 +33,7 @@ extern "C" fn did_appear(this: &mut Object, _: Sel) { /// Called when the view controller receives a `viewWillDisappear` message. extern "C" fn will_disappear(this: &mut Object, _: Sel) { unsafe { - let _: () = msg_send![super(this, class!(NSViewController)), viewWillDisappear]; + let _: () = msg_send![super(&mut *this, class!(NSViewController)), viewWillDisappear]; } let controller = load::(this, VIEW_DELEGATE_PTR); @@ -43,7 +43,7 @@ extern "C" fn will_disappear(this: &mut Object, _: Sel) { /// Called when the view controller receives a `viewDidDisappear` message. extern "C" fn did_disappear(this: &mut Object, _: Sel) { unsafe { - let _: () = msg_send![super(this, class!(NSViewController)), viewDidDisappear]; + let _: () = msg_send![super(&mut *this, class!(NSViewController)), viewDidDisappear]; } let controller = load::(this, VIEW_DELEGATE_PTR); diff --git a/src/view/controller/uikit.rs b/src/view/controller/uikit.rs index 9598dd51..a95f71b3 100644 --- a/src/view/controller/uikit.rs +++ b/src/view/controller/uikit.rs @@ -13,7 +13,7 @@ use crate::view::{ViewDelegate, VIEW_DELEGATE_PTR}; /// Called when the view controller receives a `viewWillAppear:` message. extern "C" fn will_appear(this: &mut Object, _: Sel, animated: BOOL) { unsafe { - let _: () = msg_send![super(this, class!(UIViewController)), viewWillAppear: animated]; + let _: () = msg_send![super(&mut *this, class!(UIViewController)), viewWillAppear: animated]; } let controller = load::(this, VIEW_DELEGATE_PTR); @@ -23,7 +23,7 @@ extern "C" fn will_appear(this: &mut Object, _: Sel, animated: /// Called when the view controller receives a `viewDidAppear:` message. extern "C" fn did_appear(this: &mut Object, _: Sel, animated: BOOL) { unsafe { - let _: () = msg_send![super(this, class!(UIViewController)), viewDidAppear: animated]; + let _: () = msg_send![super(&mut *this, class!(UIViewController)), viewDidAppear: animated]; } let controller = load::(this, VIEW_DELEGATE_PTR); @@ -33,7 +33,7 @@ extern "C" fn did_appear(this: &mut Object, _: Sel, animated: B /// Called when the view controller receives a `viewWillDisappear:` message. extern "C" fn will_disappear(this: &mut Object, _: Sel, animated: BOOL) { unsafe { - let _: () = msg_send![super(this, class!(UIViewController)), viewWillDisappear: animated]; + let _: () = msg_send![super(&mut *this, class!(UIViewController)), viewWillDisappear: animated]; } let controller = load::(this, VIEW_DELEGATE_PTR); @@ -43,7 +43,7 @@ extern "C" fn will_disappear(this: &mut Object, _: Sel, animate /// Called when the view controller receives a `viewDidDisappear:` message. extern "C" fn did_disappear(this: &mut Object, _: Sel, animated: BOOL) { unsafe { - let _: () = msg_send![super(this, class!(UIViewController)), viewDidDisappear: animated]; + let _: () = msg_send![super(&mut *this, class!(UIViewController)), viewDidDisappear: animated]; } let controller = load::(this, VIEW_DELEGATE_PTR);