Re: getting the bundle name
Re: getting the bundle name
- Subject: Re: getting the bundle name
- From: Ondra Cada <email@hidden>
- Date: Sun, 24 Mar 2002 15:09:16 +0100
On Sunday, March 24, 2002, at 08:43 , Donald Hall wrote:
I am trying to get the bundle name for my app using NSBundle methods, but
am not having any luck. Can anyone help?
Here is a code fragment:
NSString *bundleName;
NSBundle *myBundle;
myBundle = [NSBundle mainBundle];
NSLog(@"main bundle is %@", myBundle);
bundleName= [myBundle bundleIdentifier];
NSLog(@"bundle name is %s", bundleName);
There is a world of difference between a bundle identifier (a string which
uniquely identifies your bundle; you have not set it, but if you did, it
should be somrthing like "net.theboss.appsmore.RaiseMan"), a bundle name
(which is localizable and could be determined as
[[myBundle infoDict] objectForKey:(NSString*)kCFBundleName]
(unless I have missed something, there is no direct accessor method like
that one for the identifier), and the bundle path, which is quite simply
[myBundle bundlePath]
If you wanted the bundle wrapper name, well then it's a part of bundle
path, and therefore should be determined by
[[myBundle bundlePath] lastPathComponent]
---
Ondra Cada
OCSoftware: email@hidden
http://www.ocs.cz
2K Development: email@hidden
http://www.2kdevelopment.cz
private email@hidden
http://www.ocs.cz/oc
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.