• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: CFBundleGetInfoString Question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: CFBundleGetInfoString Question


  • Subject: Re: CFBundleGetInfoString Question
  • From: Nicholas Riley <email@hidden>
  • Date: Tue, 26 Nov 2002 23:37:29 -0600
  • Mail-followup-to: Tom Gray <email@hidden>, email@hidden

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.

References: 
 >CFBundleGetInfoString Question (From: Tom Gray <email@hidden>)

  • Prev by Date: Re: proper location for a database file
  • Next by Date: Re: AddressBook, ABMultiValue, and indexForIdentifier
  • Previous by thread: CFBundleGetInfoString Question
  • Next by thread: Re: CFBundleGetInfoString Question
  • Index(es):
    • Date
    • Thread