X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/fb45bb1fb231dd982d5196766dbca2ce161c0ea4..04fdd8736a403bb3c6b2bd1430e48178dd8b7e45:/src/cocoa/NSButton.mm diff --git a/src/cocoa/NSButton.mm b/src/cocoa/NSButton.mm index c228460dd4..1728984c53 100644 --- a/src/cocoa/NSButton.mm +++ b/src/cocoa/NSButton.mm @@ -47,7 +47,7 @@ WX_IMPLEMENT_POSER(wxPoserNSButton); @implementation wxPoserNSButton : NSButton - (void)wxNSButtonAction: (id)sender { - wxASSERT_MSG(self==sender,"Received wxNSButtonAction from another object"); + wxASSERT_MSG((id)self==sender,"Received wxNSButtonAction from another object"); wxCocoaNSButton *button = wxCocoaNSButton::GetFromCocoa(self); wxCHECK_RET(button,"wxNSButtonAction received without associated wx object"); button->Cocoa_wxNSButtonAction(); @@ -57,8 +57,11 @@ WX_IMPLEMENT_POSER(wxPoserNSButton); void wxCocoaNSButton::AssociateNSButton(WX_NSButton cocoaNSButton) { - sm_cocoaHash.insert(wxCocoaNSButtonHash::value_type(cocoaNSButton,this)); - [cocoaNSButton setTarget: cocoaNSButton]; - [cocoaNSButton setAction: @selector(wxNSButtonAction:)]; + if(cocoaNSButton) + { + sm_cocoaHash.insert(wxCocoaNSButtonHash::value_type(cocoaNSButton,this)); + [cocoaNSButton setTarget: cocoaNSButton]; + [cocoaNSButton setAction: @selector(wxNSButtonAction:)]; + } }