- (IBAction)sendButton:(id)sender {
NSString *locationFormatter = [NSString stringWithFormat:@"https://maps.google.com?saddr=Current+Location&daddr=%f,%f", self.locationManager.location.coordinate.latitude, self.locationManager.location.coordinate.longitude];
if ([MFMailComposeViewController canSendMail]){
MFMailComposeViewController *mailComposer = [[MFMailComposeViewController alloc]init];
mailComposer.mailComposeDelegate = self;
[mailComposer setSubject:@"Google Maps Directions"];
[mailComposer setToRecipients:@[@"castro.michael87@gmail.com"]];
[mailComposer setMessageBody:@"Google Maps Url:locationFormatter" isHTML:NO];
// Display Mail Composer
[self presentViewController:mailComposer animated:YES completion:nil];
}
How do I insert the locationFormatter string in the MessageBody? I was hoping this would work:
[mailComposer setMessageBody:@"%@",locationFormatter isHTML:NO];