Trying to get a .framework 's bundle version. Tried to find the file using path for 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 path keeps coming back nil......
Better way?
A framework is a bundle (a structured directory) that contains a dynamic shared library along with associated resources, such as nib files, image files, and header files. When you develop an application, your project links to one or more frameworks.
For xcode version click xcode>about xcode. For the framework just open a header file from that framework, usually in the comments on top the version is mentioned.
A representation of the code and resources stored in a bundle directory on disk.
Module: A set of parts that can be assembled into a structure. To Xcode, that means you can have a group of lines of code that you can (re)use in different places without having to write that code again.
NSArray *ar = [NSBundle allFrameworks];
for (NSBundle *b in ar) {
NSLog(@"%@",[b objectForInfoDictionaryKey:@"CFBundleName"]);
NSLog(@"%@",[b objectForInfoDictionaryKey:@"CFBundleShortVersionString"]);
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With