For Windows there is Win32 API, what about for Mac?

风格不统一 提交于 2019-12-12 14:57:56

问题


For Windows there is Win32 API, what about for Mac? On Wikipedia

http://en.wikipedia.org/wiki/Cocoa_(API)

it is said that Cocoa is "one of" the API... what about the full story?


回答1:


At what level? The low level API is largely but not entirely FreeBSD, and below that there is still a Mach API (some things still use Mach ports for IPC, I believe; at least, launchd supports them). At the upper level are two APIs: Cocoa and Carbon. Cocoa is the native API; Carbon is intended for programs ported from older MacOS. (Which includes parts of OSX itself; for a long time Finder was a Carbon app.)

The Windows situation isn't all that different, actually; there was for a long time a Win16 emulation API present in 32-bit Windows, and in the early days of Windows NT it had both POSIX and 16-bit OS/2 APIs.




回答2:


That pretty much is the full story. Mac OS X does support other APIs, but they're either deprecated (Carbon), or intended primarily to support "foreign" software (Java, X11, POSIX). The native API is Cocoa.




回答3:


Mac OS X is Unix underneath. That's the "other" API.



来源:https://stackoverflow.com/questions/5446761/for-windows-there-is-win32-api-what-about-for-mac

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!