我尝试在我的Git
存储库中合并两个分支,并且在Storyboard
文件上发生了一些冲突。以下是冲突的界限:
<resources>
<image name="IconAddToCart" width="30" height="34"/>
<<<<<<< HEAD
<image name="IconAddToCart" width="30" height="34"/>
=======
<image name="IconCartBig" width="149" height="111"/>
>>>>>>> 0133fd1364e6e590034bba1c0e32273bcf22a3d2
<image name="IconCheckmark" width="13" height="13"/>
<image name="LoginBackground" width="320" height="568"/>
<image name="LoginBackground" width="320" height="568"/>
<image name="LoginLogo" width="257" height="73"/>
<image name="ScanButton" width="178" height="61"/>
</resources>
<color key="tintColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<simulatedMetricsContainer key="defaultSimulatedMetrics">
<simulatedStatusBarMetrics key="statusBar"/>
<simulatedOrientationMetrics key="orientation"/>
<simulatedScreenMetrics key="destination" type="retina4"/>
</simulatedMetricsContainer>
<inferredMetricsTieBreakers>
<segue reference="rCk-dF-YMq"/>
<segue reference="SKx-bH-AaC"/>
<segue reference="ofx-gD-lnj"/>
<segue reference="Eo1-ee-RYE"/>
<segue reference="mb5-Kc-qz1"/>
<segue reference="qYH-kM-beE"/>
<segue reference="QOW-kb-Y6W"/>
<<<<<<< HEAD
<segue reference="vKq-do-lYa"/>
=======
<segue reference="CgX-ql-qnP"/>
<segue reference="gwc-Z9-zHd"/>
>>>>>>> 0133fd1364e6e590034bba1c0e32273bcf22a3d2
</inferredMetricsTieBreakers>
我尝试通过删除重复的代码行并删除冲突标记来修复冲突,这就是文件的这一部分现在的样子:
<resources>
<image name="IconAddToCart" width="30" height="34"/>
<image name="IconCartBig" width="149" height="111"/>
<image name="IconCheckmark" width="13" height="13"/>
<image name="LoginBackground" width="320" height="568"/>
<image name="LoginBackground" width="320" height="568"/>
<image name="LoginLogo" width="257" height="73"/>
<image name="ScanButton" width="178" height="61"/>
</resources>
<color key="tintColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<simulatedMetricsContainer key="defaultSimulatedMetrics">
<simulatedStatusBarMetrics key="statusBar"/>
<simulatedOrientationMetrics key="orientation"/>
<simulatedScreenMetrics key="destination" type="retina4"/>
</simulatedMetricsContainer>
<inferredMetricsTieBreakers>
<segue reference="rCk-dF-YMq"/>
<segue reference="SKx-bH-AaC"/>
<segue reference="ofx-gD-lnj"/>
<segue reference="Eo1-ee-RYE"/>
<segue reference="mb5-Kc-qz1"/>
<segue reference="qYH-kM-beE"/>
<segue reference="QOW-kb-Y6W"/>
<segue reference="vKq-do-lYa"/>
<segue reference="CgX-ql-qnP"/>
<segue reference="gwc-Z9-zHd"/>
</inferredMetricsTieBreakers>
即便如此,编译器仍然会给我以下错误:The document "Main.storyboard"could not be opened. The operation couldn't be completed. (com.apple.InterfaceBuilder error -1.)
如果我已经删除了这些行,可能是错误的原因是什么?
答案 0 :(得分:3)
此行重复:
<image name="LoginBackground" width="320" height="568"/>
Xcode 5可以修复它(并告诉你这可能是因为SCM合并而发生),但是你可能使用旧版本的Xcode,这可能无法解决这个问题。