title: email sheet can't be canceled?
body: <p>I am opening an email sheet to send a file. It works great except that I can't go back to my app.</p>
  
  <p>When I hit cancel button, it ask if to delete or save draft, and stay there. It doesn't go back to app page.</p>
  
  <p>code:</p>
  
  <pre><code>//send email log-------------------------
      NSLog(@"mail");
      [[CCDirector sharedDirector] pause];
  
      picker = [[MFMailComposeViewController alloc] init];
      picker.mailComposeDelegate = self;
  
      //Fill in the email as you see fit
      NSArray *toRecipients = [NSArray arrayWithObject:@"name@gmail.com"]; 
      [picker setToRecipients:toRecipients];
  
  
      NSArray *paths2 = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
      NSString *dataPath = [[paths2 objectAtIndex:0] stringByAppendingPathComponent:@"Test.txt"];
      NSData *data = [NSData dataWithContentsOfFile:dataPath];
      [picker addAttachmentData:data mimeType:@"text/txt" fileName:@"Test.txt"];
  
      NSString *emailBody = @"Test   ";
      [picker setMessageBody:emailBody isHTML:NO];
      [picker setSubject:@"hardware test ##   "];
  
      //display the view
      [[[CCDirector sharedDirector] openGLView] addSubview:picker.view];
      [[CCDirector sharedDirector] stopAnimation]; 
  </code></pre>
  
  <p><strong>EDIT:</strong></p>
  
  <p>I have added the function suggested in the answer right here, he calls the function when I hit cancel, but it stays in that sheet.
  I have to say that I am using a cclayer (cocos2d) so the layer is defined with :</p>
  
  <pre><code>@interface HelloWorldLayer : CCLayer&lt; MFMailComposeViewControllerDelegate&gt;
  </code></pre>
  
  <p>Any other suggestion ?</p>
  
  <p>Thanks a lot.</p>