The following code isn’t working out for me. Whenever the method is called the app crashes What have i done wrong?
This code does use a storyboard format
in the .h file
@class SendVideoViewController;
...
@property (nonatomic) SendVideoViewController *sendVideoViewController;
in the .m file
#import "SendVideoViewController.h"
...
@synthesize sendVideoViewController;
...
- (IBAction)signMeUpButtonPressed:(id)sender {
termsAndConditionsViewController = [[TermsAndConditionsViewController alloc] init];
[self presentViewController:termsAndConditionsViewController animated:YES completion:nil];
//[self.view insertSubview:termsAndConditionsViewController.view atIndex:0];
}
Your code should read:
Right now you are instantiating a generic
UIViewControllerclass. In order to create an object of the type which you have defined in yourSendVideoViewControllerclass, you need to call+allocon that class, notUIViewController. You might want to brush up on the documentation.