• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: bundle version number troubles
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: bundle version number troubles


  • Subject: Re: bundle version number troubles
  • From: Douglas Davidson <email@hidden>
  • Date: Mon, 10 Feb 2003 15:31:39 -0800

On Monday, February 10, 2003, at 02:15 PM, stupidFish programming wrote:

i want to use the build number for one of my functions.
i read somewhere, that

NSString *currVersionNumber = [[[NSBundle bundleForClass:[self
class]] infoDictionary] objectForKey:@"CFBundleVersion"];

gives the bundle's version (build?) number as a string. now what I need
is an int value, so after going through NSBundle.h (I think), I found
CFBundleGetVersionNumber(), which takes a bundle and returns its
version number, so I figured I would try

NSLog(@"%d", CFBundleGetVersionNumber(CFBundleGetMainBundle()));

to check if it works, but the app logs 0, whereas the first function,
returns a string that reads 425 (actual version number).

Two things: first, the second line of code here gets the version for the main bundle rather than the bundle your class is in. Second, the numeric CFBundle version is a 'vers'-style BCD version number, e.g. 12.3.4a5, where the first number before the decimal point is at most two digits.

Douglas Davidson
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

References: 
 >bundle version number troubles (From: stupidFish programming <email@hidden>)

  • Prev by Date: Re: Terminating an NSThread from another thread
  • Next by Date: Re: getting contents of URL that requires username/password
  • Previous by thread: bundle version number troubles
  • Next by thread: text formats for documenting object relationships?
  • Index(es):
    • Date
    • Thread