Localizing About.xib (Quirk with Xcode)


I went beyond the enhancements to RaiseMan in ch. 16, and attempted to localize the About panel, which as per the book is loaded with NSBundle. So, I localized the About.xib in IB (by clicking “Localize…” in “Localization” in “File inspector” in Utilities in IB). After doing this, the call to [NSBundle loadNibNamed:@“About” owner:self] would return NO.

I tried Clean and Build; no luck.

After much trial and error, I decided to rename About.xib to AboutPanel.xib (and IB renamed the localized files), and changed the call to NSBundle’s method to: [NSBundle loadNibNamed:@“AboutPanel” owner:self]. That got the About panel to display, and in the correct language.

Later I renamed AboutPanel.xib back to About.xib (including localized files), and changed the method call accordingly, and the About panel would still display.

So, it seems that Xcode has a glitch where merely localizing a XIB that gets loaded with NSBundle will not work; one must also edit the implementation file so that the change gets noticed.

(If I am missing something or doing something incorrectly, I am open to clarification.)