ios – Can not name IBAction in derived class instantiated as subview


So I am making an attempt to name an IBAction that’s related to the FileOwner of a subview instantiated from an xib file

I’m working into a wierd concern, principally I’ve a base class that each one views inherit from:

ViewController.h

#import <UIKit/UIKit.h>
#import "CsoundManager.h"

@interface ViewController : UIViewController
-(IBAction) testActionBase:(id)sender;

@finish

ViewController.m

#import "ViewController.h"

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any extra setup after loading the view.
}

-(IBAction) testActionBase:(id)sender
{
    NSLog(@"Check Motion Fired");
}

@finish

after which I’ve two different view courses which inherit from this. One is the principle view that instantiates subviews.

Essential View Recordsdata:
MainViewController.h

#import "ViewController.h"

@interface MainViewController : ViewController
-(IBAction) testFireDerived:(id)sender;
@finish

MainViewController.m

#import "MainViewController.h"
#import "GlobalSequencerControlView.h"

@implementation MainViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any extra setup after loading the view.
    
    
    GlobalSequencerControlView *globalControlView = [[GlobalSequencerControlView alloc] initWithNibName:@"GlobalSequencerControls" bundle:nil];
    //self.view.userInteractionEnabled = false;
    [self.view addSubview:globalControlView.view];
     
}

-(IBAction) testFireDerived:(id)sender
{
    NSLog(@"Essential View Hearth Derived");
}

@finish

And beneath are the instantiated subclass recordsdata:

GlobalSequencerControlView.h

#import "ViewController.h"

@interface GlobalSequencerControlView : ViewController {
    
}
-(IBAction) testFireDerived:(id)sender;
@finish

GlobalSequencerControlView.m

#import "GlobalSequencerControlView.h"

@implementation GlobalSequencerControlView

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any extra setup after loading the view.
}

-(IBAction) testFireDerived:(id)sender
{
    NSLog(@"International Sequencer Hearth Derived");
}
@finish

Once I wire up a button throughout the subview loaded from the xib, I’m unable to get the testFireDerived IBAction present in GlobalSequencerViewController.m to execute. The buttons are receiving the contact occasions as I’m able to get the testActionBase technique from the inherited class to fireplace when linked to the button.

Any ideas/concepts as to why that is could be drastically appreciated. The buttons appear to be receiving occasions however for some purpose the derived actions usually are not being triggered though I’m wiring up the buttons to the actions in the very same method.

Related Articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest Articles