title: MFMailComposeViewController bringing up NSException
body: <p>I have done a search for this problem, and have not found an answer, which is leading me to write my firs tquestion here.</p>
  
  <p>The problem is when I press the button which calls the metho below, I get an exception on this line: <code>[self presentModalViewController:mailViewController animated:YES];</code> and the exception is: </p>
  
  <blockquote>
    <p><em>*</em> Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSCFString count]: unrecognized selector sent to instance 0x20f6c'</p>
  </blockquote>
  
  <p>In addition, I am running my app on the simulator if that helps.</p>
  
  <p>I got the magority of the code from <a href="http://www.iphonedevsdk.com/forum/iphone-sdk-development/49393-sending-plist-attachment.html" rel="nofollow">here</a>.</p>
  
  <p>Here is my code (with the email address blanked out):</p>
  
  <pre><code>    // set up the email address array
      NSArray *email = [[NSArray alloc] initWithObjects:@"foo", nil];
  
      // Set up the view controller
      MFMailComposeViewController *mailViewController = [[MFMailComposeViewController alloc] init];
      mailViewController.mailComposeDelegate = self;
  
      // Set up the email to send to
      [mailViewController setSubject:@"foo"];
      [mailViewController setToRecipients:[email objectAtIndex:0]];
  
      // Get the path to the plist
      NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); 
      NSString *documentsPath = [paths objectAtIndex:0];  
      NSString *path = [documentsPath stringByAppendingPathComponent:@"foo.plist"];
  
      // Get the plist from the path
      NSData *myData = [NSData dataWithContentsOfFile:path];
      [mailViewController addAttachmentData:myData mimeType:@"plist" fileName:@"foo"];
  
      // Fill out the email body text 
      NSString *emailBody = @"Attached PLIST file";
      [mailViewController setMessageBody:emailBody isHTML:NO];
  
      // Release the array
      [email release];
  
      if (mailViewController != nil) {
          [self presentModalViewController:mailViewController animated:YES];
          [mailViewController release];
      }
  </code></pre>
  
  <p>What appears to be causing the exception?</p>