title: PushViewController to current navigation controller from another class
body: <p>I am creating a class object from my UIViewController and trying to push a controller from it,  and it won't work.</p>
  
  <p>I have been doing research but found nothing, any idea?</p>
  
  <hr>
  
  <pre><code>@implementation ViewController
   - (void)viewDidLoad
  {
    [super viewDidLoad];
    self.newClass = [[MyNewClass alloc] init];
    self.newClass.view = self.view;
    self.newClass.navigationController = self.navigationController;
    [self.newClass connect];
  }
  ...
  @end
  </code></pre>
  
  <hr>
  
  <p>MyNewClass.h</p>
  
  <pre><code>@interface MyNewClass : NSObject&lt;UINavigationControllerDelegate&gt;
    @property(nonatomic, retain) UIView *view;
    @property(nonatomic, retain) UINavigationController *navigationController;
    -(void) connect;
  @end
  </code></pre>
  
  <hr>
  
  <p>MyNewClass.m</p>
  
  <pre><code>-(void)connect
  {
   OtherViewController * otherVC =
                               [[OtherViewController alloc] init];
  
  
    self.navigationController pushViewController:otherVC animated:YES];
  } 
  ...
  </code></pre>