xcode 编辑xml文件时界面生成器故事板编译器错误

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/11016974/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 00:35:49  来源:igfitidea点击:

Interface builder storyboard compiler error when editing the xml file

iphonexmlxcodeipad

提问by Reex

I manually add element in the storyboard file of my iPhone/iPad developement.
In fact, I copy views in storyboard for iPad and I compute the proportional sizes for iPhone (1024x768 to 480x320).
It works correctly but there is an error when adding a containing several imageviews on it:

我在 iPhone/iPad 开发的故事板文件中手动添加元素。
事实上,我在 iPad 的情节提要中复制视图,并计算 iPhone 的比例大小(1024x768 到 480x320)。
它工作正常,但在添加包含多个图像视图时出现错误:

*CompileStoryboard iboniaIphoneLGT/LGT_iphone.storyboard
    cd /Users/imac/Desktop/WORKSPACE
    setenv IBSC_MINIMUM_COMPATIBILITY_VERSION 5.1
    setenv PATH "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
    setenv XCODE_DEVELOPER_USR_PATH /Applications/Xcode.app/Contents/Developer/usr/bin/..
/Applications/Xcode.app/Contents/Developer/usr/bin/ibtool 
    --errors 
    --warnings 
    --notices 
    --output-format human-readable-text 
    --compile 
            /Users/imac/Desktop/WORKSPACE/build/Debug-iphonesimulator/LGT.app/LGT_iphone.storyboardc 
            /Users/imac/Desktop/WORKSPACE/iboniaIphoneLGT/LGT_iphone.storyboard 
    --sdk /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.1.sdk

Command /Applications/Xcode.app/Contents/Developer/usr/bin/ibtool 
failed with exit code 255*

The message is not explicit, what is the possible cause of this message???

消息不明确,这个消息的可能原因是什么???

Reex

雷克斯

回答by Bedevere

I was getting this error and eventually found that when I selected one of the images used in the xib in the project navigator, it did not have the project checked in the File Inspector under "Target Membership". Once I checked that, I didn't get the error anymore.

我收到此错误并最终发现,当我在项目导航器中选择 xib 中使用的图像之一时,它没有在“目标成员资格”下的文件检查器中检查该项目。一旦我检查了这一点,我就不再收到错误了。

So I would suggest checking all the images and other resources used in the xib and make sure they have their target membership correct.

因此,我建议检查 xib 中使用的所有图像和其他资源,并确保它们的目标成员资格正确。

回答by Simone

In my case this was caused by adding one equal-width constraint. It does not make sense. I am pretty wary of Xcode by now.

就我而言,这是由添加一个等宽约束引起的。它没有任何意义。我现在对 Xcode 非常警惕。

回答by Bodlund

For me the solution was just to remove some warnings I had. The warnings I changed was just changing var:s to let:s on properties that was not changed on 4 places

对我来说,解决方案只是删除我的一些警告。我更改的警告只是将 var:s 更改为 let:s 在 4 个地方未更改的属性上