个人学习笔记存放地
技巧
上一篇 /
下一篇 2008-04-22 13:55:00
/ 个人分类:MAC
1. 启动应用程序
system("open /Applications/Safari.app");
The "open" command works as if you double-clicked the file.
system("/Applications/Safari.app/Contents/MacOS/Safari");
You would get a new instance of Safari. Much like opening multiple instances of IE in Windows. But this isn't Mac behavior. so use "open" instead.
2. help
If it's a help file, don't forget that OS X provides a standard framework for dealing with those. Otherwise, you could use something like the following, which will open a resource file using the default application for that file type:
Code:
NSString *path = [[NSBundle mainBundle] pathForResource: @"yourfile" ofType: @"html"];
BOOL success = [[NSWorkspace sharedWorkspace] openFile: path];
导入论坛
收藏
分享给好友
管理
举报
TAG:
Safari
framework
技巧
Applications
app