New To Mac-Forums?

Welcome to our community! Join the discussion today by registering your FREE account. If you have any problems with the registration process, please contact us!

Get your questions answered by community gurus Advice and insight from world-class Apple enthusiasts Exclusive access to members-only contests, giveaways and deals

Join today!

 
Start a Discussion
 

Mac-Forums Brief

Subscribe to Mac-Forums Brief to receive special offers from Mac-Forums partners and sponsors

Join the conversation RSS
OS X - Development and Darwin Discussion and questions about development for Mac OS X.

Reliable was to get current OS Version in MAC.


Post Reply New Thread Subscribe

 
Thread Tools
Marimuthu

 
Member Since: Oct 18, 2011
Posts: 1
Marimuthu is on a distinguished road

Marimuthu is offline
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"];
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 Thanks

Post Reply New Thread Subscribe


« Developing kernel extension: How to get kernal output in terminal? | mark message as unread applescript »
Thread Tools

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
Thread
Thread Starter
Forum
Replies
Last Post
OS 10.7 Lion feature/rumour roundup the8thark Apple Rumors and Reports 44 08-17-2011 02:03 PM
Upgrade of Office 2011 for Mac for Mac Pro purchasers prior to Nov 30 What Version? StuartB OS X - Apps and Games 1 01-21-2011 03:06 PM
Mac Users Get More ISP Choices schweb Apple Rumors and Reports 1 03-06-2003 10:57 AM

All times are GMT -4. The time now is 03:12 AM.

Powered by vBulletin
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
X

Welcome to Mac-Forums.com

Create your username to jump into the discussion!

New members like you have made this community the ultimate source for your Mac since 2003!


(4 digit year)

Already a member?