I've managed to find a bug in iOS8.1 when using RESideMenu and trying to send mail.
I'm using boiler plate MFMailComposer code (works fine on plain projects), but appears to break when called under RESideMenu.
Tried the below (perfectly functioning w/o RESideMenu) code in both ObjC and Swift, on iPhone6 and iPhone5, no change.
var mc: MFMailComposeViewController!
func shareTest()
{
if MFMailComposeViewController.canSendMail()
{
mc = MFMailComposeViewController()
mc.setSubject("subject")
mc.setToRecipients(["[email protected]"])
mc.setMessageBody("...", isHTML: false)
mc.mailComposeDelegate = self
self.presentViewController(mc, animated: true, completion: nil)
}
}
func mailComposeController(controller: MFMailComposeViewController!, didFinishWithResult result: MFMailComposeResult, error: NSError!) {
self.dismissViewControllerAnimated(true, completion: nil)
}
The assertion text is:
*** Assertion failure in -[MFMailComposeInternalViewController _endDelayingCompositionPresentation], /SourceCache/MessageUI/MessageUI-1466.1.2/Mail/MFMailComposeInternalViewController.m:322
*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'should have delayed presentation'
Calling the presentViewController in a dispatch_after ~5 - 10 seconds doesnt' solve the issue. Netiher does calling it from the root view controller instead of the current one.
Also, the search for "should have delayed presentation" yeilds nothing in google.
Coming back to post my "solution" here since I was reminded about this in the RESideMenu repo and haven't heard any responses otherwise.
After much debugging my own code, it turns out the issue was with the library I was using.
I switched over from RESideMenu to SWReveal, and after this - no issues with MFMailComposer or exporting, so there seems to be an unresolved bug in RESideMenu for this.