Determine my app's version number programatically?

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

  1. macrumors member

    Joined:
    Jul 16, 2002
    Location:
    Dallas, TX
    #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

    Joined:
    Nov 3, 2007
    #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. thread starter macrumors member

    Joined:
    Jul 16, 2002
    Location:
    Dallas, TX
    #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

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

Share This Page