objective c - Cocoa: Button Control in secondary .xib (loaded from MainWindowController) fails to invoke its Action -
a simple test application using xcode 7.3 under macos 10.10 using objective c. appdelegate.h @property mainwindowcontroller *mymainwindowcontroller; appdelegate.m - (void)applicationdidfinishlaunching:(nsnotification *)anotification { _mymainwindowcontroller = [[mainwindowcontroller alloc] initwithwindownibname:@"mainwindowcontroller"]; [_mymainwindowcontroller showwindow:self]; } the mainwindowcontroller.xib mainwindow main view mainwindowcontroller.h @property iboutlet nsview * mainview; //hooked view in mainwindowcontroller.xib mainwindowcontroller.m - (void)windowdidload { [super windowdidload]; myxib* vc = [[myxib alloc] initwithnibname:nil bundle:nil]; [_mainview addsubview:[vc view] ]; } myxib created in xcode subclass of nsviewcontroller. has button object, in view. myxib.h @interface myxib : nsviewcontroller - (ibaction)buttonpushed:(id)sender; myxib.m - (void)viewdidload { [super viewdidload]; } - (ibaction)bu...