Chris
Chris

Reputation: 1013

Is it possible to access XCode's Target Version and Build Numbers?

In XCode, for an IOS application target, you can set Version and Build numbers. Is there a way to access these numbers from within a program's code? I have these numbers duplicated inside my app with some user defaults and I keep thinking there's a better way to do this.

Thanks.

Upvotes: 3

Views: 739

Answers (1)

Simon Lee
Simon Lee

Reputation: 22334

You can use something like the following...

[[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleShortVersionString"]

Upvotes: 6

Related Questions