Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7640767
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T08:45:10+00:00 2026-05-31T08:45:10+00:00

I am using Apple’s sample code for the MessageUI and MFMailComposeViewControllerDelegate, and mostly it

  • 0

I am using Apple’s sample code for the MessageUI and MFMailComposeViewControllerDelegate, and mostly it works great. But for some reason when I implement it, the text in the recipient fields appears out of alignment with the field labels, and you can only see half of the cursor and half of the text while typing. Once you’ve typed the addresses and exited the field, the text is completely visible, though still out of alignment with the labels. I have looked at other apps’ implementations of the MessageUI, and they do not seem to have this problem. has anyone seen this problem and found a solution?

Below is code:

-(void)displayComposerSheet 
{
   MFMailComposeViewController *picker = [[MFMailComposeViewController alloc] init];  
   picker.mailComposeDelegate = self;

   [picker setSubject:@"Data"];

   // Set up recipients
   NSArray *toRecipients = [NSArray arrayWithObject:@"email@example.com"]; 

   [picker setToRecipients:toRecipients];

   // Attach an attachment to the email
   NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
   NSString *documentsDirectory = [paths objectAtIndex:0];
   NSString *csvFile = [documentsDirectory stringByAppendingPathComponent:@"myFile.csv"];
   NSData *myData = [NSData dataWithContentsOfFile:csvFile];
   NSString *filename = @"myFile.csv";
   [picker addAttachmentData:myData mimeType:@"text/csv" fileName:filename];

   // Fill out the email body text
   NSString *emailBody = @"Attached is the data";
   [picker setMessageBody:emailBody isHTML:NO];

   [self presentModalViewController:picker animated:YES];

}

The problem occurs in both the simulator and on device.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T08:45:11+00:00Added an answer on May 31, 2026 at 8:45 am

    Probably, you’ve got a custom UITextField in your app and have some custom code in – (CGRect)textRectForBounds:(CGRect)bounds. If you’d like to have some category for UITextField class, try to put your specific code directly to the class where you using that instead of using category, which affects all textfields in your app, even in MFMailComposeViewController

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using some code which was originally taken from the Apple sample ViewTransitions
i am using apple's sample URLCache ,but when i mention url, it loads data
I'm using Apple's sample code for having separate Portrait and Landscape view controllers (presenting/dismissing
I was using apple's scrollview sample code PhotoScroller for my app using numerous images
I'm using Apple's SecKeyWrapper class from the CryptoExercise sample code in the Apple docs
I am using apple's custom table view cell code and modifying the drawRect code
Apple advises using the following code to detect whether running on an iPad or
I am using Apple's MuiltipleDetailViewController sample app and get the message UIViewController may not
I am using Apple's CoreDataBooks sample project as a learning aid for core data.
I found some private (undocumented) APIs but Apple does not allow apps to use

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.