Re: Reverse of fullPathForApplication
Re: Reverse of fullPathForApplication
- Subject: Re: Reverse of fullPathForApplication
- From: Douglas Davidson <email@hidden>
- Date: Fri, 9 Jul 2004 11:55:42 -0700
On Jul 9, 2004, at 11:24 AM, Audun Wilhelmsen wrote:
Try openening the Info.plist file in Application.app/Contents/, then
read the CFBundleName string.
Example code:
NSDictionary *infoList = [NSDictionary dictionaryWithContentsOfFile:
@"/Applications/iTunes.app/Contents/Info.plist"];
NSLog(@"Application name of iTunes: %@", [infoList objectForKey:
@"CFBundleName"]);
You really should use NSBundle or CFBundle to get the info dictionary
rather than hard-coding something like "Contents/Info.plist". There
are a variety of recognized bundle formats, each of which has a
different location for it.
Douglas Davidson
_______________________________________________
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.