Re: bundle version number troubles
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.