Forums
New posts
Articles
Product Reviews
Policies
FAQ
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Menu
Log in
Register
Install the app
Install
Forums
macOS & iOS Developer Playground
macOS - Development and Darwin
Reliable was to get current OS Version in MAC.
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="Marimuthu" data-source="post: 1312219" data-attributes="member: 218896"><p>Hi All,</p><p></p><p>I am working on Snow Leopard and work for a product based company. In one of our company's product, in the About box I need to display the current MAC OS Version.</p><p></p><p>Wanted to know if using the "SystemVersion.plist" method to determine the OS Name and version is the most reliable method available?</p><p></p><p> [CODE]NSString *versionString;</p><p> NSDictionary * sv = [NSDictionary dictionaryWithContentsOfFile:@"/System/Library/CoreServices/SystemVersion.plist"];</p><p> versionString = [sv objectForKey:@"ProductVersion"];[/CODE]</p><p></p><p>I want to avoid making use of technique where major,minor versions are used to determine the current OS version as this method requires often requires formatting hardcoded strings to generate OS Version. </p><p></p><p>The above-mentioned code will give us the current OS Version as a string which can be displayed as it is.</p><p></p><p>Can I safely use this approach for current and future version of MAC (Lion and higher version of MAC which might be released in near future)?</p></blockquote><p></p>
[QUOTE="Marimuthu, post: 1312219, member: 218896"] Hi All, I am working on Snow Leopard and work for a product based company. In one of our company's product, in the About box I need to display the current MAC OS Version. Wanted to know if using the "SystemVersion.plist" method to determine the OS Name and version is the most reliable method available? [CODE]NSString *versionString; NSDictionary * sv = [NSDictionary dictionaryWithContentsOfFile:@"/System/Library/CoreServices/SystemVersion.plist"]; versionString = [sv objectForKey:@"ProductVersion"];[/CODE] I want to avoid making use of technique where major,minor versions are used to determine the current OS version as this method requires often requires formatting hardcoded strings to generate OS Version. The above-mentioned code will give us the current OS Version as a string which can be displayed as it is. Can I safely use this approach for current and future version of MAC (Lion and higher version of MAC which might be released in near future)? [/QUOTE]
Verification
Post reply
Forums
macOS & iOS Developer Playground
macOS - Development and Darwin
Reliable was to get current OS Version in MAC.
Top