I need to get the 'nice' Mac OS X version string (e.g., "10.5.8"). Other sources say to use the "ge开发者_运维技巧stalt" to reliably get this value. The problem is, the Gestalt is a Carbon API and I can't link to Carbon (its a long story). Is there some other way, perhaps a direct Cocoa method?
How about
[[NSProcessInfo processInfo] operatingSystemVersionString]
You can run sw_vers in an NSTask and sort through its output.
精彩评论