IPhone / iPad iOS How to get the version of the Framework Bundle

Trying to get .framework package version. Tried to find the file using the path for the resource and then use NSBundle something like ...

NSString *path = [[NSBundle mainBundle] pathForResource:@"SomeFramework" ofType:@"framework"]; NSBundle *bundle = [[NSBundle alloc] initWithPath:path]; _version = [bundle objectForInfoDictionaryKey:(NSString *)kCFBundleVersionKey]; 

But the path keeps coming back ...

The best way?

+6
source share
1 answer
 NSArray *ar = [NSBundle allFrameworks]; for (NSBundle *b in ar) { NSLog(@"%@",[b objectForInfoDictionaryKey:@"CFBundleName"]); NSLog(@"%@",[b objectForInfoDictionaryKey:@"CFBundleShortVersionString"]); } 
+3
source

Source: https://habr.com/ru/post/953493/


All Articles