我是开发 Mac 应用程序的新手,在我的应用程序中,我需要像在 iPhone 中一样打开邮件撰写,但我无法找到我必须使用的框架。
任何人都知道这一点,如何打开邮件撰写窗口。
问候
解决此问题的一种方法是使用 NSAppleScript 类。如果您至少对 AppleScript 有点熟悉,那应该不会太难。
NSAppleScript *mailScript;
NSString *scriptString= [NSString stringWithFormat:@"tell application \"Mail\"\nmake new outgoing message with properties {visible:true, subject:\"%@\", content:\"%@\"}\nactivate\nend tell",subject,body];
mailScript = [[NSAppleScript alloc] initWithSource:scriptString];
[mailScript executeAndReturnError:nil];