• 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: Xcode Build numbers and versioning
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Xcode Build numbers and versioning


  • Subject: Re: Xcode Build numbers and versioning
  • From: Jean-Daniel Dupas <email@hidden>
  • Date: Tue, 18 Dec 2007 11:59:01 +0100

Le 18 déc. 07 à 11:38, email@hidden a écrit :

Hello All,

How do I obtain the version info in Objective-C?

So that I can do something like:
targetBinary --version

Reference:
http://chanson.livejournal.com/125568.html


You have to declare the variable:

extern const double $(PRODUCT_NAME)VersionNumber

For a project Foo, this will be:

extern const double FooVersionNumber;

int main(int argc, char **argv) {
printf("product version: %f\n", FooVersionNumber);
return 0;
}

You can find the declared variables into derived sources. (in you project intermediates build files directory, search for "DerivedSources").

See man agvtool for more information

To enable Apple Generic Versioning, then, you must set up at least the VERSIONING_SYSTEM and CURRENT_PROJECT_VERSION project build settings for each project you want to be versioned.  
The target of a versioned project will have two global variables generated and linked into your product.  One is of type double and is simply the CURRENT_PROJECT_VERSION.  
The other is a version string which is formatted to be compatible with what(1).  These variables are available for use in your code.

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >Xcode Build numbers and versioning (From: email@hidden)

  • Prev by Date: Xcode Build numbers and versioning
  • Next by Date: Re: Xcode Build numbers and versioning
  • Previous by thread: Xcode Build numbers and versioning
  • Next by thread: Re: Xcode Build numbers and versioning
  • Index(es):
    • Date
    • Thread