Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

zkmusa

macrumors regular
Original poster
Jul 16, 2002
104
17
Dallas, TX
I have a disclaimer which I'd like to change only when the application has been updated (hence, the version number will have changed).

I'd like to programatically determine what the version number for my app. What's the correct function or class I should be looking in? Thanks!
 

Jeremy1026

macrumors 68020
Nov 3, 2007
2,215
1,029
Umm...silly question I'm sure but, since each release can only have one version number, why not just manually display it in your program?
 

zkmusa

macrumors regular
Original poster
Jul 16, 2002
104
17
Dallas, TX
Umm...silly question I'm sure but, since each release can only have one version number, why not just manually display it in your program?

Well, the point is to display the disclaimer only once when they update their program.

For future reference, this post explains how to go about doing this very well. Just replace "myVersionNumber" with "CFBundleVersion".
 

kainjow

Moderator emeritus
Jun 15, 2000
7,958
7
Well, the point is to display the disclaimer only once when they update their program.

For future reference, this post explains how to go about doing this very well. Just replace "myVersionNumber" with "CFBundleVersion".

Not sure why they're using CoreFoundation functions. The Cocoa way:
Code:
NSString *appVersion = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleVersion"];
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.