我尝试在我的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.)
如果我已经删除了那些代码,可能是什么原因导致了这个错误?
<image name="LoginBackground" width="320" height="568"/>
。Xcode 5 可以修复此问题(并告诉您这可能是由于 SCM 合并引起的),但您可能使用的是旧版本的 Xcode,无法解决此问题。 - Vili