我正在开发一个应用程序,我想将字符串显示stringValue
为一个变量,以便在有人想通过电子邮件从我的应用程序共享某些内容时显示。
- (IBAction)openMail:(id)sender {
if ([MFMailComposeViewController canSendMail])
{
MFMailComposeViewController *mailer = [[MFMailComposeViewController alloc] init];
mailer.mailComposeDelegate = self;
[mailer setSubject:@"My App"];
NSArray *toRecipients = [NSArray arrayWithObjects:@"tony@starkindustries.com", nil];
[mailer setToRecipients:toRecipients];
NSString *emailBody = [@"Rating is: %@", [self.app.rating stringValue];
[mailer setMessageBody:emailBody isHTML:NO];
[self presentModalViewController:mailer animated:YES];
}
打开邮件时如何使[self.app.rating stringValue];
显示为“Rating Is: some_number ”?也许我%@
写错了部分?任何帮助,将不胜感激。提前致谢!