How can I check the software version of our application programmatically?

I made an application and I installed it on my iphone, but I want to check the version of the application. How can I do that?

+27
iphone
Apr 17 '10 at 6:17
source share
2 answers
NSString *versionString = [[NSBundle mainBundle] objectForInfoDictionaryKey:(NSString*)kCFBundleVersionKey]; 
+73
Apr 17 '10 at 6:29
source share

Here are some macros:

 #define BUNDLE_VERSION_EQUAL_TO(v) ([[[NSBundle mainBundle] objectForInfoDictionaryKey:(NSString*) kCFBundleVersionKey] compare:v options:NSNumericSearch] == NSOrderedSame) #define BUNDLE_VERSION_GREATER_THAN(v) ([[[NSBundle mainBundle] objectForInfoDictionaryKey:(NSString*) kCFBundleVersionKey] compare:v options:NSNumericSearch] == NSOrderedDescending) #define BUNDLE_VERSION_GREATER_THAN_OR_EQUAL_TO(v) ([[[NSBundle mainBundle] objectForInfoDictionaryKey:(NSString*) kCFBundleVersionKey] compare:v options:NSNumericSearch] != NSOrderedAscending) #define BUNDLE_VERSION_LESS_THAN(v) ([[[NSBundle mainBundle] objectForInfoDictionaryKey:(NSString*) kCFBundleVersionKey] compare:v options:NSNumericSearch] == NSOrderedAscending) #define BUNDLE_VERSION_LESS_THAN_OR_EQUAL_TO(v) ([[[NSBundle mainBundle] objectForInfoDictionaryKey:(NSString*) kCFBundleVersionKey] compare:v options:NSNumericSearch] != NSOrderedDescending) 
+16
Apr 25 2018-12-12T00:
source share



All Articles