Reputation: 121
I am sending email from iphone application i want that
in body field right now MyScroe and My Time are showing on same line i want that they should be on separate line each how to show that
NSString * emailBody = [NSString stringWithFormat:@"My Score: %d/%d, My Time: %@", numberOfCorrectAnswer, [[[DataManager sharedInstance] questions] count], time];
[picker setMessageBody:emailBody isHTML:NO];
Upvotes: 0
Views: 1738
Reputation: 130193
You can insert a line break in this string by using the "\n" escape. Every "\n" represents a line break where ever it is added.
Upvotes: 0
Reputation: 6152
Use escape sequences for it. Try \n
of new line. One \n
for one line
NSString * emailBody = [NSString stringWithFormat:@"My Score: %d/%d, \n\nMy Time: %@", numberOfCorrectAnswer, [[[DataManager sharedInstance] questions] count], time];
Upvotes: 0
Reputation: 5454
"\n\r"
should work in your case. If you wish to change to html (isHTML:YES
), then you'll have to use "<br/>"
NSString * emailBody = [NSString stringWithFormat:@"My Score: %d/%d\n\rMy Time: %@", numberOfCorrectAnswer, [[[DataManager sharedInstance] questions] count], time];
Upvotes: 5