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 6565377
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T14:05:12+00:00 2026-05-25T14:05:12+00:00

I’m in the process of using a plist to populate a uitableview. I was

  • 0

I’m in the process of using a plist to populate a uitableview. I was wondering, because one of my keys is email, what type would it be? Data, string, etc. The basic idea is to have a table, you tap the email cell, and up comes with the email modal view. How do i go about doing this?
Thanks

  • 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-25T14:05:12+00:00Added an answer on May 25, 2026 at 2:05 pm

    The data type I would use would be a string. You can then pull out this string and use it where you need it. In the case of email, you will need to do the following (I am assuming you are able to read the string out of the plist and use it within a UITableViewCell):

    #pragma mark -
    #pragma mark Compose Mail
    
    -(void)callMailComposer
    {
        Class mailClass = (NSClassFromString(@"MFMailComposeViewController"));
        if (mailClass != nil)
        {
            // We must always check whether the current device is configured for sending emails
            if ([mailClass canSendMail])
            {
                [self displayComposerSheet];
            }
            else
            {
                [self launchMailAppOnDevice];
            }
        }
        else
        {
            [self launchMailAppOnDevice];
        }
    }
    
    // Displays an email composition interface inside the application. Populates all the Mail fields. 
    -(void)displayComposerSheet
    {
        MFMailComposeViewController *picker = [[MFMailComposeViewController alloc] init];
        picker.mailComposeDelegate = self;
        [picker setSubject:@"My email subject"];
    
       //Just an extra example if you were wanting to add an attachment :)
       /* NSString* pdfFileName = @"pdf_file.pdf";
        NSArray* documentDirectories = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask,YES);
        NSString* documentDirectory = [documentDirectories objectAtIndex:0];
        NSString* documentDirectoryFilename = [documentDirectory stringByAppendingPathComponent:pdfFileName];
    
        [picker addAttachmentData:[NSData dataWithContentsOfFile:documentDirectoryFilename] mimeType:@"application/pdf" fileName:pdfFileName]; */
    
        // Set up recipients
        [picker setCcRecipients:nil];   
        [picker setBccRecipients:nil];
        [picker setToRecipients:[NSArray arrayWithObjects:@"myEmailAddressFromPlist",nil]];
    
        NSString *emailBody = @"Hey you got mail";
        [picker setMessageBody:emailBody isHTML:YES];
    
        [self presentModalViewController:picker animated:YES];
    
        [picker release];
         picker=nil;
    }
    
    // Dismisses the email composition interface when users tap Cancel or Send. Proceeds to update the message field with the result of the operation.
    - (void)mailComposeController:(MFMailComposeViewController*)controller didFinishWithResult:(MFMailComposeResult)result error:(NSError*)error
    {    
        NSString* alertMessage;
        // Notifies users about errors associated with the interface
        switch (result)
        {
            case MFMailComposeResultCancelled:
                alertMessage = @"Email composition cancelled";
            break;
            case MFMailComposeResultSaved:
                alertMessage = @"Your e-mail has been saved successfully";
            break;
            case MFMailComposeResultSent:
                alertMessage = @"Your email has been sent successfully";
            break;
            case MFMailComposeResultFailed:
                alertMessage = @"Failed to send email";
            break;
            default:
                alertMessage = @"Email Not Sent";
            break;
        }
    
        UIAlertView* alertView = [[UIAlertView alloc] initWithTitle:@"My application" message:alertMessage delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil];
        [alertView show];
        [alertView release];
    
        [self dismissModalViewControllerAnimated:YES];
    }
    
    #pragma mark Workaround
    
    // Launches the Mail application on the device.
    -(void)launchMailAppOnDevice
    {
    
    //You will need to fill these in 
        NSString *recipients = @"mailto:?cc=&subject=";
        NSString *body = @"&body=";
        NSString *email = [NSString stringWithFormat:@"%@%@", recipients, body];
        email = [email stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
        [[UIApplication sharedApplication] openURL:[NSURL URLWithString:email]];
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like to count the length of a string with PHP. The string
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I am reading a book about Javascript and jQuery and using one of the
I have thousands of HTML files to process using Groovy/Java and I need to
I'm making a simple page using Google Maps API 3. My first. One marker
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I want to count how many characters a certain string has in PHP, but
For some reason, after submitting a string like this Jack’s Spindle from a text
I've got a string that has curly quotes in it. I'd like to replace

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.