• 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
NSBundle strange behavior
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSBundle strange behavior


  • Subject: NSBundle strange behavior
  • From: p3consulting <email@hidden>
  • Date: Wed, 17 Aug 2005 21:36:55 +0200

Hi all,

Does somebody have an explanation (or even a beginning of explanation) about a possible cause of following strange problem:

In the same application the following lines output what may be considered as inconsistent results:

CFBundleCopyLocalizedString ( CFBundleGetMainBundle(), CFSTR("CFBundleName"), CFSTR("DefaultValue"), CFSTR("InfoPList"))

returns correctly the CFBundleName value of the currently active localized InfoPList.strings

when
[[[NSBundle mainBundle] localizedInfoDictionary] objectForKey:@"CFBundleName"]
[[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleName"]
both returns nil


and
[[NSBundle mainBundle] pathForResource:@"InfoPList" ofType:@"strings"]
returns the correct path and in consequence
[[NSDictionary dictionaryWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"InfoPList" ofType:@"strings"]] objectForKey:@"CFBundleName"]
returns the correct CFBundleName value



The problem happens in a multi-target project in a target that has been created by duplicating the main one.
and - of course - the "main" target (the first one created) doesn't exhibit the problem...
(Panther targets compiled on Panther)


(and all these calls are in the same block of code...)


Why could cause "localizedInfoDictionary" to fail when other "equivalent" ways to access the same data all succeed ????



Pascal Pochet email@hidden ---------------------------------- PGP KeyID: 0x208C5DBF Fingerprint: 9BFB 245C 5BFE 7F1D 64B7 C473 ABB3 4E83 208C 5DBF _______________________________________________ Do not post admin requests to the list. They will be ignored. Cocoa-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
  • Follow-Ups:
    • Re: NSBundle strange behavior
      • From: Douglas Davidson <email@hidden>
  • Prev by Date: Transparent NSTableView. Is it possible?
  • Next by Date: Re: NSTextInput protocol - 'unmarkText' is late?
  • Previous by thread: Re: Transparent NSTableView. Is it possible?
  • Next by thread: Re: NSBundle strange behavior
  • Index(es):
    • Date
    • Thread