是否有 NSPerformService(@"Tweet", [NSPasteboard GeneralPasteboard]);
带有图像?我知道简单的文本是可能的,但我不知道图像。
如果是,示例代码会很好。
谢谢。
PS:对于那些不知道的人来说,这只有在用户安装了 Twitter.app 的情况下才有可能。
最佳答案
您可以发送到服务的类型取决于注册应用程序在其 Info.plist
中声明的类型。对于 Twitter.app
,这看起来像:
<key>NSMenuItem</key>
<dict>
<key>default</key>
<string>Tweet</string>
</dict>
<key>NSSendTypes</key>
<array>
<string>NSStringPboardType</string>
</array>
不幸的是,这意味着您必须将图像转换为字符串才能被服务接受。
关于objective-c - NSPerformService "Tweet"与图像 (Twitter.app),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10965496/