title: Big issue with IBAction in custom class called from a view controller
body: <p>I have the following code, which I have put together because I just don't understand the logs I'm getting. I originally had a nib-file from where I had an action connected to one of the buttons. the code would never change the view as Im trying, so I tried to connect the button by tag instead and just adding a method for a tap event. Now take note that the two methods are identical, the difference is only the way they are connected (both methods get called). But in the IBAction method sunPushed currentVC is NULL (logs posted below, but you get the point), even though its equivalent regular method holds the reference correctly. Can somebody please shed any light on the subject, it's been bugging me all day that I can't figure out why this is happening. Any help is greatly appreciated! (I've been thinking theres some difference in how the compiler treats an IBAction vs reg. method)</p>
  
  <p>headerfile:</p>
  
  <pre><code>#import &lt;UIKit/UIKit.h&gt;
  
  @interface FooterViewTest1 : UIView
  //@property (strong, nonatomic) UIButton *button1;
  @property (strong, nonatomic) UIViewController *currentVC;
  @property (strong, nonatomic) IBOutlet UIButton *button1;
  
  -(void)buttonPushed;
  -(void)initButtons:(UIViewController *)viewController;
  @end
  </code></pre>
  
  <p>implementation</p>
  
  <pre><code>#import "FooterViewTest1.h"
  #import "StartViewController.h"
  
  @implementation FooterViewTest1
  
  -(void)initButtons:(UIViewController *)viewController{
  
  /*UIButton *button1 = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, 320, 180)];
  [button1 setImage:[UIImage imageNamed:@"menu_bar_sun_black"] forState:UIControlStateNormal];
  [button1 addTarget:self action:@selector(buttonPushed) forControlEvents:UIControlEventTouchUpInside];
  [viewController.view addSubview:button1];*/
  self.currentVC = viewController;
  
  NSArray *nibContents = [[NSBundle mainBundle] loadNibNamed:@"RaymioFooterView" owner:nil options:nil];
  UIView *footerView = [viewController.view viewWithTag:1];
  UIView *footerViewContent = [nibContents lastObject];
  NSLog(@"SELFinside initbuttons%@", self);
  NSLog(@"currentVCinside initbuttons%@", self.currentVC);
  
  UIButton *button1X = (UIButton *)[footerViewContent viewWithTag:5];
  [button1X addTarget:self action:@selector(buttonPushed) forControlEvents:UIControlEventTouchUpInside];
  
  [footerView addSubview:footerViewContent];
  }
  
  - (IBAction)sunPushed{
  NSLog(@"SELFinside sunpushed%@", self);
  NSLog(@"currentVCinside sunpushed%@", self.currentVC);
  UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"Main" bundle:nil];
  StartViewController *startViewController = [storyboard instantiateViewControllerWithIdentifier:@"StartViewController"];
  [self.currentVC presentViewController:startViewController animated:YES completion:nil];
  }
  
  -(void)buttonPushed{
  NSLog(@"SELFinside buttonpushed%@", self);
  NSLog(@"currentVCinside buttonpushed%@", self.currentVC);
  UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"Main" bundle:nil];
  StartViewController *startViewController = [storyboard instantiateViewControllerWithIdentifier:@"StartViewController"];
  [self.currentVC presentViewController:startViewController animated:YES completion:nil];
  }
  
  @end
  </code></pre>
  
  <p>see the below image</p>
  
  <p><img src="https://i.stack.imgur.com/q3zEA.png" alt="enter image description here"></p>
  
  <p>Thanks again!</p>
  
  <p>Initialising footerView:</p>
  
  <pre><code> self.footerViewTest = [FooterViewTest1 new];
  //self.footerViewTest.currentVC = self;
  [self.footerViewTest initButtons:self];
  </code></pre>