Re: CFBundleGetInfoString Question
Re: CFBundleGetInfoString Question
On Tue, Nov 26, 2002 at 11:30:08PM -0500, Tom Gray wrote:
>
How can I get a hold of CFBundleGetInfoString from within my program?
>
>
I tried this:
>
>
NSDictionary *pListStrings;
>
>
pListStrings = [NSDictionary dictionaryWithContentsOfFile:[[NSBundle
>
mainBundle] pathForResource:@"Info" ofType:@"pList"]];
>
NSLog(@"count:%i", [pListStrings count]);
>
NSLog([pListStrings objectForKey:@"CFBundleGetInfoString"]);
Try this:
NSBundle *bundle = [NSBundle mainBundle];
NSLog([bundle localizedStringForKey: @"CFBundleGetInfoString"
value: [[bundle infoDictionary]
objectForKey: @"CFBundleGetInfoString"]
table: @"InfoPlist"]);
You can just take the [[bundle infoDictionary] objectForKey:] part if
you don't care about localization; in fact at least the 10.1.x Finder
doesn't even consult InfoPlist.strings for a localized long version
string.
--
=Nicholas Riley <email@hidden> | <
http://www.uiuc.edu/ph/www/njriley>
Pablo Research Group, Department of Computer Science and
Medical Scholars Program, University of Illinois at Urbana-Champaign
_______________________________________________
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.