문제

I have quite a big and complex project with multiple storyboards, all localized in 2 languages. I have 4 storyboards - main iPhone, main iPad and another 2 for a separate feature.

Here are the problems I have..

2 of these Storyboards are duplicated in the project. When I manage to run, somehow at runtime, one of these storyboards is picked. When I edit the storyboard, I will have to edit in both files.

Copy 1

Copy 1

Copy 2

Copy 2

The other problem is that I then have a mess in the directory of the project. I have 2 copies of a localized version of the resources.. therefore 2 it.proj folder, one in the root folder of the project and one in the source folder.

it.proj folder inside the root directory of the project it.proj folder inside the root directory of the project

storyboards inside the source code folder AgentAssist

storyboards inside the source code folder

more localized resources

enter image description here

enter image description here

enter image description here

The problems these are causing is unusual.. sometimes is just runs fine, and sometimes I get different errors. One would be

Compilation failed. Unable to write to path: /User.....Underlying Err Description: The file “CMAStoryboard_iPad.storyboardc” couldn’t be saved in the folder “Base.lproj” because a file with the same name already Failure Reason: A file with the name “CMAStoryboard_iPad.storyboardc” already Recovery Suggestion: To save the file, either provide a different name, or move aside or delete the existing file, and tr Underlying Description: The operation couldn’t be completed. Failure Reason: Description: “CMAStoryboard_iPad.storyboardc” couldn’t be removed because you don’t have permission to ac Failure Reason: You don’t have per Recovery Suggestion: To view or change permissions, select the item in the Finder and choose File > G Underlying Description: The operation couldn’t be completed. Directo Failure Reason: Directo....

The other alternative error would be a Copy .strings file error. error: failed to remove ...../Xcode/DerivedData/AgentAssist-bgxpswehldjaxchamdipxdcfafbf/Build/Products/Debug-iphoneos/AgentAssist.app/it.lproj/CMAStoryboard.strings: “CMAStoryboard.strings” couldn’t be removed.

Then sometimes after cleaning, deleting derived-data folder and even not doing anything, it just runs.

Your help would be greatly appreciated as I cannot resolve this issue and I can't go on working with the project.

Thank you

도움이 되었습니까?

해결책

For each storyboard file name (or really any resource in Xcode) you should only have one source document with that file name. Resources with the same name are all mapping to the same output file, and you're seeing results of this undefined behavior resolve in various ways.

So if you have this:

ProjectRoot/Base.lproj/MyStoryboard.storybaord ProjectRoot/Folder/Folder/Base.lproj/MyStoryboard.storybaord

Then both of those documents map to the same output file.

You need to either delete the one at ProjectRoot/Base.lproj or the one at ProjectRoot/Folder/Folder/Base.lproj, but do not keep both documents.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top