1. Welcome to the new MacRumors forums. See our announcement and read our FAQ

Determine my app's version number programatically?

Discussion in 'iPhone/iPad Programming' started by zkmusa, Aug 23, 2008.

  1. macrumors member

    #1
    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!
     
  2. macrumors 68000

    #2
    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?
     
  3. macrumors member

    #3
    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".
     
  4. Moderator emeritus

    kainjow

    #4
    Not sure why they're using CoreFoundation functions. The Cocoa way:
    Code:
    NSString *appVersion = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleVersion"];
     

Share This Page