以格式字符串添加回车符

时间:2011-06-02 20:20:14

标签: cocoa-touch email string-formatting

我试图在我的电子邮件正文中的每个字符串后返回Carriage。我正在画一个空白。

这是我目前正在使用的代码:

- (IBAction)mailButtonPressed {
    MFMailComposeViewController *controller = [[MFMailComposeViewController alloc] init];
    controller.mailComposeDelegate = self;
    [controller setSubject:@"Pressed Data..."];

    appDelegate= (TemplateIponeAppDelegate *)[UIApplication sharedApplication].delegate;

    NSString *MessageBody=[NSString stringWithFormat:@" Hi: %@ F Result: %d , R Result: %d , B Result: %d,  P Result: %d......... total Reults: %d   total time :%@",clientName.text, appDelegate.FCount,appDelegate.RCount,appDelegate.BCount,appDelegate.PCount,appDelegate.TotalPressed,appDelegate.time];

    [controller setMessageBody:MessageBody isHTML:NO];
    [self presentModalViewController:controller animated:YES];
    [controller release];
}

1 个答案:

答案 0 :(得分:3)

在格式字符串中的任何位置添加\n