大家好,感谢您的宝贵时间。我相信我有一个简单的问题。
我正在尝试剥离字符串电子邮件正文的引号(它们似乎来自从字典中获取我的正文)并将其传递给 MailObject .... 没有运气,我一直在我的 *finalString 行上获得 SIGBRT。
我错过了什么。再次感谢任何帮助。
NSMutableDictionary *my_data = [myMasterOrderList objectAtIndex:[self.tableView indexPathForCell:cell].row];
NSMutableArray *toEmail = [[NSMutableArray alloc] init];
[toEmail addObject:[my_data objectForKey:@"repemail"]];
NSMutableString *toBody = [my_data objectForKey:@"myOrder"];
// [toBody addObject:[my_data objectForKey:@"myOrder"]];
// NSString *finalSting = [[NSString alloc] init];
NSMutableString *finalString = [NSMutableString stringWithFormat:@"%@",[toBody stringByReplacingOccurrencesOfString:@"\"" withString:@"%20"]];
NSLog(@" toBody my_data%@", finalString);
//************* SEND MAIL *************
if ([MFMailComposeViewController canSendMail]) {
MFMailComposeViewController *mailViewController = [[MFMailComposeViewController alloc] init];
mailViewController.mailComposeDelegate = self;
[mailViewController setToRecipients:toEmail];
[mailViewController setSubject:@"Sub Goes Here."];
[mailViewController setMessageBody:finalString isHTML:NO];
[self presentModalViewController:mailViewController animated:YES];