I want to read the files contained within the framework info.plist my own creation. When I try to read, the rferans it've read his file info.plist framework applications.
I need to read both. How can I do it? Could you help?
NSLog(@"*** %@", [[[NSBundle mainBundle] localizedInfoDictionary] valueForKey:@"ASD"]);
NSLog(@"*** %@", [[[NSBundle mainBundle] infoDictionary] valueForKey:@"ASD"]);
NSLog(@"*** %@", [[[[NSBundle allFrameworks] objectAtIndex:0] infoDictionary] valueForKey:@"ASD"]);
First create bundle by using your framework path:
NSString* mainBundlePath = [[NSBundle mainBundle] resourcePath];
NSString* frameworkBundlePath = [mainBundlePath stringByAppendingPathComponent:@"YourFrameworkBundle.bundle"];
frameworkBundle = [NSBundle bundleWithPath:frameworkBundlePath];
Then access Info Dictionary or what you want
Thank you for your answers.
Solution are as shown below:
[[[NSBundle bundleForClass:[self class]] infoDictionary] objectForKey:@"ASD"]
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.