NSBundle strange behavior
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