Try this code. It will help you ......
In the button click action, you must submit your UINavigationController and the current ViewController. Because the NSObject class did not find this controller.
In your Button action, put this code:
[demo login_method_called:self.navigationController withCurrentViewController:self]
In your NSObject.h class, put this code:
#import <Foundation/Foundation.h> #import "Home_ViewController.h" @interface Method_Action_class : NSObject - (void)login_method_called:(UINavigationController*)navigation withCurrentViewController:(UIViewController*) controller; @end
In your NSObject.m class, put this code:
#import "Method_Action_class.h" @implementation Method_Action_class -(void)login_method_called:(UINavigationController*)navigation withCurrentViewController:(UIViewController*) controller { Home_ViewController *home = [[Home_ViewController alloc] initWithNibName:@"Home_ViewController" bundle:nil]; [navigation pushViewController:home animated:YES]; } @end
And build your code.
SR Nayak
source share