是否可以写一个 C++ MacOS X 屏幕保护程序根本不使用 Objective-C?
我问 Google 如何用 C++ 编写 Mac 屏幕保护程序,他告诉了我很多关于如何在 Objective-C 中创建简单屏幕保护程序的事情,而我真的很想避免这些事情。
有没有办法像在Windows系统下那样将可执行文件作为屏幕保护程序?
I asked Google how to write a Mac screensaver with c++ and he told me many things about how to create a simple screensaver in Objective-C which I would really like to avoid.
Is there any way to do like under Windows systems where you can put an executable file as screensaver ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果你用 Objective-C 编写一些东西,当你编译它时,它就会成为可执行文件,这与你用 C 或 C++ 编写的东西没有什么不同。既然所有原生 Mac 库都是为 Obj-C 设计的,为什么要避免它呢? Obj-C 是 C 的一个非常小的超集,除了对象系统之外,实际上并没有太大的不同。你可以说,如果 C 是英语,C++ 是英语-法语洋泾浜语,随机添加了中文和纳瓦霍语(为了表达能力,你知道),那么 Objective-C 有点像苏格兰语 - 非常接近,即使很少有人不熟悉它理解它......
我没有回答实际的问题 - @Shyam 处理了这个问题:D
If you write something in Objective-C, it will become an executable when you compile it, no different than if you do it in C or C++. Since all the native Mac libraries are designed for Obj-C, why do you want to avoid it? Obj-C is a very small superset of C, not that much different really, except for the object system. You could say that if C is English and C++ is English-French pidgin with random additions of Chinese and Navajo (for expressivity, you know), Objective-C is kind of like Scots - very close, even if few people not familiar with it understand it...
I didn't answer the actual question - @Shyam took care of that :D