1

I am building my first IOS iphone 6 app.

I am having problem getting Xcode to pick up key/value pairs from the localized version of Localizable.strings. The NSLocalizedString() method seems to be returning cache entries from before I localized the Localizable.strings file.

  1. You can see in the screenshot below that when I only had only one Localizable.strings file, the code picks up the key/value pair I was looking for just fine https://www.evernote.com/l/AAIi1y9qYi5H9o_SiUduTECZJZMvYr5FCfw
  2. When I tried localizing the Localizable.strings file (i.e. having Base, English, Chinese version of the file), NSLocalizedString() returns the key value from when I had one Localizable.strings file. https://www.evernote.com/l/AALbxEQwnuVFHaHMLduAgZw5N1op8o2Alc8 I know this is happening because when I change the values for the same key across all three files, it's still returning the old value.

I've also tried

  1. Resetting the simulator settings (this suggests the cache is in the build)
  2. Restarting the simulator/Xcode
  3. Searching for the old value in my project, couldn't find the old values that NSLocalizedString is returning
  4. Changing the key to something else altogether, NSLocalizedString just returns the key in this case
  5. Recreating Localizable.strings file and localizing it again using File Inspector, same thing happens consistently each time

I am really running out of ideas. I am using Xcode: Version 6.3.1 (6D1002), any help would be much appreciated :)

2
  • Give latest version of Xcode a try, and also try the app on a device and see if your results change. Jul 23, 2015 at 17:22
  • According to the accepted answer this issue is not reproducible because a project clean fixed it.
    – Kyll
    Jul 28, 2015 at 17:34

1 Answer 1

1

Turned out I had to clean the build. Go to Product -> Clean in xcode.

Not the answer you're looking for? Browse other questions tagged or ask your own question.