title: pdf not added to email in objective-c in IOS 5
body: <p>I am trying to add an email as an attachment to my mail. I do it like this.</p>
  
  <pre><code>-(IBAction)mailPDF:(id)sender{
      MFMailComposeViewController* controller = [[MFMailComposeViewController alloc] init];
      controller.mailComposeDelegate = self;
      NSLog(@"myData is %@",myData);
      [controller setSubject:@"Geselecteerde favorieten van Genk on Stage"];
      [controller setMessageBody:@"&lt;p&gt;Hallo muziekliefhebber &lt;br /&gt; In bijlage vind je jouw favorieten. Volg en praat met ons mee op facebook.com/genkonstage of @genkonstage!&lt;br /&gt; Veel plezier op Genk on stage! &lt;/p&gt;" isHTML:YES];
      if (controller){
          [self presentModalViewController:controller animated:YES];
          [controller addAttachmentData:myData mimeType:@"application/pdf" fileName:@"favorite.pdf"];
      }else{
          NSLog(@"nothing to show");
      }
  }
  </code></pre>
  
  <p>This is how I set myData </p>
  
  <pre><code>NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
      NSString *filePath = [[paths objectAtIndex:0] stringByAppendingPathComponent:@"favorite.pdf"];
   myData = [NSData dataWithContentsOfFile: filePath];
  </code></pre>
  
  <p>When I look at my log <code>myData</code> (which is my pdf) it is NOT empty. Also when I browse in the finder to my documents folder of the <code>simulator</code> I see that I have a PDF. </p>
  
  <p>Can someone tell me why my pdf is not added to my mail ?</p>
  
  <p>thank you! </p>
  
  <p><strong>EDIT</strong>
  It seems that above code only works in IOS6. So the question is now. Why is it not working in IOS 5</p>