I have a project that uses several storyboards. In starting to internationalize/localize it, I've begun differentiating the storyboards. However, I've found that non-default (i.e. not MainStoryboard.storyboard) files are compiled but not copied into the bundle. For instance, the following files are present:

./DerivedData/.../fr-CA.lproj/MainStoryboard.storyboardc

./Library/Application Support/iPhone Simulator/.../fr-CA.lproj/MainStoryboard.storyboardc

./DerivedData/.../fr-CA.lproj/Foo.storyboardc

BUT, this one is not:

./Library/Application Support/iPhone Simulator/.../fr-CA.lproj/Foo.storyboardc

Suggestions/ideas are welcome. I'm at the point where I'm considering writing a script to just copy over these resources manually, assuming that will even work.

有帮助吗?

解决方案

I found a solution, though "work around" is probably a better description:

  1. Remove the storyboard (or XIB) from any Target Membership;
  2. Do a clean build (and clean the build folder as well);
  3. Close XCode;
  4. Delete the app from the device/simulator;
  5. Delete the contents of XCode's DerivedData directory (see Preferences);
  6. Rebuild and launch the app, navigating to the area where the storyboard/XIB is expected (this should cause a crash);
  7. Re-add the storyboard/XIB under Target Membership;
  8. Rebuild and launch.

Step #6 is the most important. If the app doesn't crash it means that you have a cached copy of the file somewhere, which is no good. I have no idea exactly why this fixes things, though I wish I did.

After this, things work swimmingly (using Base Internationalization or not).

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top