Anyone know why I am getting this error?
Terminating app due to uncaught exception \'NSInvalidArgumentException\', reason: \'-[CustomRaisedTabViewController
action: @selector(cancel:)
For the action selector which takes parameter! cancel: that means which will take another parameter.
change your method to
-(IBAction)cancel:(id)sender{
// Do wat you want
}
or
-(IBAction)cancel:(UIButton *)btnSender{
/// Do what you want
}
you have to modify the cancel method signature in
-(IBAction)cancel:(id)sender
{
[self.parentViewController dismissModalViewControllerAnimated:YES];
}
when you added the action to your cancelButton (during initialization) you specified the "cancel:" selector, this means that it will be called a method having one parameter (the sender button)
Because the cancel:
method is not cancel
which is what you've defined.
Change your cancel
action to look like this:
- (IBAction)cancel:(id)sender {
...
}