title: Inheritance on view controller Objective c
body: <p>I am trying to create a generic view controller and 2 other views which both will inherit from.</p>
  
  <p>Now this is the generic view (what i think is relevant - if something else is needed i will add it):</p>
  
  <pre><code>@interface CardGameViewController ()
  @property (strong, nonatomic) IBOutlet UITabBarItem *TabSelection;
  @property (strong, nonatomic) CardMatchingGame *game;
  @property (strong, nonatomic) IBOutlet UIButton *resetButton;
  @property (weak, nonatomic) IBOutlet UILabel *scoreLable;
  @property (strong, nonatomic) IBOutletCollection(UIButton) NSArray *cardButtons;
  @end
  
  @implementation CardGameViewController
  
  - (CardMatchingGame*)game
  {
      if(!_game) _game = [[CardMatchingGame alloc]initWithCardCount:[self.cardButtons count] usingDeck:[self createDeck] gameMode:[self getActiveTabWithString:self.TabSelection.description]];
      return _game;
  }
  
  - (Deck*)createDeck //abstract
  {
      return nil;  &lt;------- Relevant generic function
  }
  </code></pre>
  
  <p>and these are the 2 files which inherit the mentioned file:</p>
  
  <p>SetGameViewController.h:</p>
  
  <pre><code>#import "CardGameViewController.h"
  
  @interface SetGameViewController : CardGameViewController
  
  @end
  </code></pre>
  
  <p>SetGameViewController.m:</p>
  
  <pre><code>#import "SetGameViewController.h"
  #import "SetCardDeck.h"
  
  @interface SetGameViewController ()
  
  @end
  
  @implementation SetGameViewController
  
  -(Deck*)createDeck
  {
      return [[SetCardDeck alloc]init];
  }
  
  @end
  </code></pre>
  
  <p>and the second one:</p>
  
  <p>PlayingCardGameViewController.h:</p>
  
  <pre><code>#import "CardGameViewController.h"
  
  @interface PlayingCardGameViewController : CardGameViewController
  
  @end
  </code></pre>
  
  <p>PlayingCardGameViewController.m:</p>
  
  <pre><code>#import "PlayingCardGameViewController.h"
  #import "PlayingCardDeck.h"
  
  @interface PlayingCardGameViewController ()
  
  @end
  
  @implementation PlayingCardGameViewController
  
  - (Deck*)createDeck
  {
      return [[PlayingCardDeck alloc]init];
  }
  @end
  </code></pre>
  
  <p>I also have tab bar navigator to switch between the 2 views.</p>
  
  <p>The thing is, the first (SetGameViewController) is never instantiated no matter what i do,</p>
  
  <p>Meaning the <code>createDeck</code> function is never called,</p>
  
  <p>While the second one (PlayingCardGameViewController) is ok every time.</p>
  
  <p>What i have tried:</p>
  
  <p>placing break points on the main view <code>- (CardMatchingGame*)game</code> function. </p>
  
  <p>this one only gets called when i am trying to start the second working view, and not the bad one.</p>
  
  <p>If there is anything missing to give a certain lead, please let me know and i will add it.</p>