@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();
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:)];
+ }
}