在格式字符串中添加回车符
我试图在电子邮件正文中的每个字符串后获取回车符。我正在画一个空白。
这是我目前正在使用的代码:
- (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];
}
I am trying to get Carriage returns after each string in my email body. I am drawing a blank.
This is the code I’m using at the moment:
- (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];
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在格式字符串中需要换行的位置添加
\n
。Add a
\n
in your format string wherever you want a new line.