Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- NSBundle *bundle = [NSBundle mainBundle];
- if ([[bundle.bundleURL pathExtension] isEqualToString:@"appex"]) {
- // Peel off two directory levels - MY_APP.app/PlugIns/MY_APP_EXTENSION.appex
- bundle = [NSBundle bundleWithURL:[[bundle.bundleURL URLByDeletingLastPathComponent] URLByDeletingLastPathComponent]];
- }
- NSString *appDisplayName = [bundle objectForInfoDictionaryKey:@"CFBundleDisplayName"];
- var bundle = NSBundle.mainBundle()
- if bundle.bundleURL.pathExtension == "appex" {
- // Peel off two directory levels - MY_APP.app/PlugIns/MY_APP_EXTENSION.appex
- bundle = NSBundle(URL: bundle.bundleURL.URLByDeletingLastPathComponent!.URLByDeletingLastPathComponent!)!
- }
- let appDisplayName = bundle.objectForInfoDictionaryKey("CFBundleDisplayName")
- var bundle = Bundle.main
- if bundle.bundleURL.pathExtension == "appex" {
- // Peel off two directory levels - MY_APP.app/PlugIns/MY_APP_EXTENSION.appex
- let url = bundle.bundleURL.deletingLastPathComponent().deletingLastPathComponent()
- if let otherBundle = Bundle(url: url) {
- bundle = otherBundle
- }
- }
- let appDisplayName = bundle.object(forInfoDictionaryKey: "CFBundleDisplayName")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement