I have two view controllers: one ViewController
and the other TextViewController
. I give the definition of the function in ViewController and want to call this in TextViewController, but I am unable to do this. Please help me through this.
Declaration of the function in .h class
@interface ViewController : UIViewController
-(void)getVideo;
Definition of the function in .m class
-(void)getVideo{
NSString *inputPath = [[NSBundle mainBundle]pathForResource:@"GalaxyTutorial" ofType:@"mp4"];
NSURL *inputURL = [[NSURL alloc]initFileURLWithPath:inputPath isDirectory:YES];
MPMoviePlayerViewController* moviePlayer = [[MPMoviePlayerViewController alloc] initWithContentURL: inputURL];
[mpc.view setFrame: self.view.bounds];
[self.view addSubview:moviePlayer.view];
}
And i am calling this in TextViewController.m like this
ViewController *dtl = [[ViewController alloc]init];
[dtl getVideo];
Any help will be appreciated.