Re: objectForKey crashes for string formats
Re: objectForKey crashes for string formats
- Subject: Re: objectForKey crashes for string formats
- From: Chuck Soper <email@hidden>
- Date: Thu, 22 May 2003 01:16:24 -0700
I believe that the @"string" directive creates an instance of NSConstantString.
I don't know why \r and %@ is causing a problem.
Shouldn't you use strings files for localization? Or do you have a
special circumstance?
http://developer.apple.com/techpubs/macosx/Cocoa/TasksAndConcepts/ProgrammingTopics/Internationalization/Concepts/StringsFiles.html
Chuck
At 9:35 AM +0200 5/22/03, Lorenzo wrote:
Hi,
I use a NSDictionary to localize my software in different languages.
I have just discovered that if I try to get from a NSDictionary
theKey = @"Cannot save the file:\r%@";
foundString = [gLanguageStringsDict objectForKey:theKey];
my application crashes if the key is in the dictionary.
And if the key is only:
theKey = @"Cannot save the file:\r";
objectForKey returns nil even if the key is in the dictionary.
And if the key is:
theKey = @"Cannot save the file:";
objectForKey finds the key and returns the string properly.
So, cannot I really use those characters \r and %@ ?
Is it a NSDictionary's bug?
Is it my fault?
Best Regards
--
Lorenzo
email: email@hidden
_______________________________________________
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.