I can't understand why I must declare conformity to both MFMessageComposeViewControllerDelegate and UINavigationControllerDelegate when using MFMessageComposeViewController.
Failure to simply declare conformity to UINavigationControllerDelegate results in a compiler warning about assigning to 'id<UINavigationControllerDelegate>' from incompatible type ViewController *const __strong'
Why isn't declaring conformity to MFMessageComposeViewControllerDelegate and implementing the delegate methods in my header enough?
There aren't even any UINavigationControllerDelegate delegate methods to implement...
Relevant code...
Mmmmplementation:
-(void)shareTrainInformation
{
NSLog(@"Sharing...");
MFMessageComposeViewController *messageComposer = [[MFMessageComposeViewController alloc] init];
messageComposer.delegate = self;
}
Header:
@interface RRDetailViewDrillDownViewController : UIViewController <MFMessageComposeViewControllerDelegate, UINavigationControllerDelegate>
Use the composer's mailComposeDelegate property: composer.messageComposeDelegate = self;
It's because that name was already taken by an unrelated delegate declared in the superclass. (UINavigationController declares a delegate property.)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With